in reply to Re^2: getting parameters
in thread getting parameters

You need to add inputs and a submit button in hello.pl

# hello.pl use CGI; use strict; my $cgi = CGI->new(); my $fname = $cgi->param('firstname'); my $lname = $cgi->param('lastname'); print "Content-Type: text/html\n\n"; print $cgi->start_html; print <<HTML; <h3>Hello</h3> <table cellpadding="5"> <tr> <td>Firstname</td> <td><b>$fname</b></td> </tr> <tr> <td>Lastname</td> <td><b>$lname</b></td> </tr> </table> <form method="post" action="welcome.pl"> <input type="hidden" name="firstname" value="$fname"/> <input type="hidden" name="lastname" value="$lname"/> <input type="submit"/> </form> </body> </html> HTML

and amend welcome.pl

#!perl # welcome.pl use CGI; use strict; my $cgi = CGI->new(); my $x = $cgi->param('firstname'); my $q = $cgi->param('lastname'); print "Content-Type: text/html\n\n"; print $cgi->start_html; print <<HTML; <h3>Welcome</h3> <table cellpadding="5"> <tr> <td>Firstname</td> <td><b>$x</b></td> </tr> <tr> <td>Lastname</td> <td><b>$q</b></td> </tr> </table> </body> </html> HTML
poj

Replies are listed 'Best First'.
Re^4: getting parameters
by bigup401 (Pilgrim) on Nov 29, 2014 at 22:05 UTC
    thanks poj it worked