in reply to How to make that works with perl

Not sure what you mean. But if you want to see what action1.pl might look like then here's a start:

#!Perl -w use strict; use CGI::Pretty qw(:standard :cgi-lib); use CGI::Carp qw(fatalsToBrowser); # Remove for production code $| = 1; # Unbuffered output if (param('submit')) { print header (); my $name = param ('name'); my $email = param ('email'); my $password = param ('password'); print "Name: $name<br/>\n"; print "Email: $email<br/>\n"; print "Password: $password<br/>\n"; } exit 0;

Generates:

Name: wibble wobble<br/> Email: wibble@wobble<br/> Password: wibble<br/>

See CGI and the Tutorials' Web Programming for more information.


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: How to make that works with perl
by chromatic (Archbishop) on Apr 14, 2007 at 03:11 UTC
    use CGI::Pretty qw(:standard :cgi-lib);

    Why :cgi-lib?

    $| = 1; # Unbuffered output

    Why force separate network packets for each of the four prints?

      Sigh. Cargo cult copy and paste from other code. :( Probably made sense in the other context, but not here.


      DWIM is Perl's answer to Gödel
Re^2: How to make that works with perl
by naikonta (Curate) on Apr 14, 2007 at 04:15 UTC
    use CGI::Carp qw(fatalsToBrowser); # Remove for production code

    I don't, unless I put more sophisticated error handling for end users on the browser. It may confused them but they still have a chance to copy paste what shown and hopefully send it to the appropriate person, instead of merely 500 Internal Server Error. End users don't have access to error.log.


    Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

      Potential black hats don't have access to the error logs either. Leaving development error output may let out something you don't want being leaked to potential attackers. Set up your web server to send an innocuous error page and leave the detailed errors for the developers' eyes only.l

        You're right :-) I was actually thinking about for internal scope applicaitons only, but I neglected to even mention it. But even then, the black hats remain such a worry in a very big organization. There was also a mix and match but proved to become "mismatch" when I put the "unless" clause. I should have stressed that I prefer the sophisticated (which is freely translated to user friendly) error message instead of the usual 500 ISE page for public apps for neither harmful nor hintful.

        Thanks for remind me that :-)


        Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!