********** Version #2 - 2/25/2003 vertical2.cgi ********** #!/usr/bin/perl use CGI qw(:standard); print header, start_html(-title=>'Vertical Printing - Version #2', -BGCOLOR=>'FFFF00'), h1('Vertical Printing Demo - Version #2'), start_form, "What's your phrase or word to go vertical? ", textfield('theWord'), p, submit, end_form, hr, 'See PERL code for version 2', hr; if (param()) { $spaces1 = " "; $spaces2 = ""; for ($i = 1; $i < length param('theWord'); $i++) { $spaces2 .= " "; } @letters = split(//, param('theWord')); print "\n
\n"; $j = @letters; for ($i = 0; $i < @letters; $i++) { print "$spaces1 $letters[$i]$spaces2" . $letters[--$j] . "\n"; $spaces1 .= " "; chop $spaces2; chop $spaces2; } print "\n\n\n