in reply to help with getting my perl script to run via web

It appears that your script needs some command line arguments. Maybe your script should contain some code that handle command line arguments. Something like this ...
... use strict; use Getopt::Std; use vars qw/ $opt_i $opt_s $opt_c $opt_h /; sub usage () { my $msg = shift || "-h prints this message"; print "$msg\nusage:$0 -i<ip addr> -s<tftp server> -c<config file> +\n"; } getopts( 'i:s:c:h' ); if ( !$opt_i ) { usage( "Please specify ip address" ); exit 1; } if ( !$opt_s ) { usage( "Please specify tftp server" ); exit 1; } if ( !$opt_c ) { usage( "Please specify config file" ); exit 1; } if ( $opt_h ) { usage; exit 0; } ...

Replies are listed 'Best First'.
Re: help with getting my perl script to run via web
by nkuitse (Sexton) on Aug 05, 2003 at 20:47 UTC
    I use this idiom in my scripts:
    exit usage("Please specify ip address") unless $opt_i; exit usage("Please specify tftp server") unless $opt_s;
    ... and so on. usage is written so it returns 1 (typically).