packing up for a ski trip....not much time...last perlmonk session for over a week...have to write something.....(perl withdrawals impending), so I haven't tested...but it should be close for a beginning of a "perl script that prints a page that can be used to fire off the perl script to do something"
hell, if it was perfect you would have the fun of debugging it, eh? :-)
good luck
#!/usr/bin/perl $|++; use strict; use CGI; my $q = new CGI(); my $thingtodo = $q->param("thingtodo"); print $q->header(); print $q->starthtml(); print qq(<form method=post action="/dir/cgi-bin/this.pl"); if ( $thingtodo eq "somethingnew" ) { somethingnew(); else defaultpage(); } print qq(</form>); $q->end_html(); exit; sub defaultpage { print $q->p("default page"); print <<EOHTML; <input type=hidden name=thingtodo value=somethingnew> <input type=submit value="press for something new"> EOHTML ; } sub somethingnew { print $q->("something new"); print <<EOHTML; <input type=submit value="press to go home"> EOHTML ; }
oh yeah, mixed some styles for outputting html...timtowtdi
In reply to Re: Sub Perl Scrips
by wardk
in thread Sub Perl Scrips
by Monolith-0
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |