Hacker News new | past | comments | ask | show | jobs | submit login

The Perl+Continuity solution also uses "first, second & third" style and does it nicely without sessions and adheres to challenge by being an established library: http://arclanguage.org/item?id=805

Here is a version using the HTML::AsSubs module:

    use Continuity;
    use HTML::AsSubs;
    Continuity->new->loop; # This starts the webserver

    sub main {
        my $request = shift;
        my $p = 'foo';

        $request->print( aform( $p )->as_HTML );
        my $foo = $request->next->param( $p );
        $request->print( w_link()->as_HTML );
        $request->next->print( "You said: $foo" );
    }

    sub aform {
        form( 
            input( { type => 'text', name => $_[0] } ), 
            input( { type => 'submit'} )
        );
    }

    sub w_link { a( { href => '.' }, 'Click Here' ) }



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: