in reply to How to get input text boxes populated
See perlintro, perlquote, perlsub... and write more subs
## #!/usr/bin/perl -- ## ro-sham-bo.pl ## ## 2014-07-07-00:03:20 ## ## ## perltidy -olq -csc -csci=10 -cscl="sub : BEGIN END if " -otr -opr +-ce -nibc -i=4 -pt=0 "-nsak=*" #!/usr/bin/perl -- use strict; use warnings; use CGI qw/ escapeHTML /; Main( @ARGV ); exit( 0 ); sub Main { my $row_hashref = { qw/ ro <row> sham "shammy" bo 'peep' /, @ARGV +}; my $html = bunchesOfTextBoxes( $row_hashref ); print $html; } sub bunchesOfTextBoxes { my( $nameVals ) = @_; my $html = ""; while( my( $name, $value ) = each %$nameVals ) { $name = escapeHTML( $name ); $value = escapeHTML( $value ); $html .= qq{<input name="$name" value="$value">\n}; } return $html; } ## end sub bunchesOfTextBoxes __END__ $ perl ro-sham-bo.pl shama lamma king kong <input name="ro" value="<row>"> <input name="king" value="kong"> <input name="shama" value="lamma"> <input name="bo" value="'peep'"> <input name="sham" value=""shammy"">
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
https://metacpan.org/pod/CGI#Creating-a-text-field
|
|---|