realn0whereman has asked for the wisdom of the Perl Monks concerning the following question:

I plan on creating a simple page with maybe a form and a submit button. The purpose is to be an admin interface for some background scripts that are run on the server. How would I go about executing a local script when an event, such as a button on the cgi perl page being pushed, occurs?

Replies are listed 'Best First'.
Re: Bash script from CGI Perl
by ahmad (Hermit) on Jul 14, 2010 at 20:21 UTC

    Something like this?

    my $q = CGI->new; if ( $q->param('btn_name') ) { system('sh myscript'); }
      That might work. going to try and implement, will post back with results (i haven't written perl in YEARS).
Re: Bash script from CGI Perl
by Anonymous Monk on Jul 14, 2010 at 20:47 UTC
Re: Bash script from CGI Perl
by aquarium (Curate) on Jul 15, 2010 at 05:07 UTC
    btw in any secure or semi-secure environment, you're likely to run into permission problems with the user id executing perl CGI not having access to shell or commands or parts of filesystem. you can use a utility of choice for sniffing file permission access errors and amend as minimally appropriate whilst still having the CGI produce results.
    the hardest line to type correctly is: stty erase ^H