in reply to Run a subroutine on "Submit"

Here is the basic structure you want.

#!/usr/bin/perl -w use strict; use CGI; my $q = new CGI; my $flag = $q->param('flag'); my $message = get_data(); display_page($message); # do mysub() if 'flag' set mysub() if $flag eq 'do_it'; exit; #### Subs #### sub display_page { my $message = shift; print $q->header, $message; } sub mysub {} sub get_data { }

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: Run a subroutine on "Submit"
by Donnie (Acolyte) on Nov 13, 2002 at 20:59 UTC
    Thank you so much! Just what I was looking for. Many blessings for your help!

      There was a typo in the original if $flag = 'do_it' should of course have been if $flag eq 'do_it'

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print