Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: help with getting my perl script to run via web

by LameNerd (Hermit)
on Aug 05, 2003 at 20:17 UTC ( [id://281147]=note: print w/replies, xml ) Need Help??


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).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://281147]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-19 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found