in reply to Command line argument
you could just check for it before.
.... or something like that. in the reg ex you could even check for the right type of input.
update
thanks to tadman for pointing out this, but I was missing an equals sign in the above.. also, got a cup of coffee in me and fixed other silly stuff.. sorry for the first poor response.
#!/usr/bin/perl $argument = $ARVG[0] || warn "No argument"; print "argv = |$ARVG[0]|\n"; if ($argument !=~/\w/ ) { print "enter an argument \n"; chomp ($argument = <STDIN>); }
.... or something like that. in the reg ex you could even check for the right type of input.
update
thanks to tadman for pointing out this, but I was missing an equals sign in the above.. also, got a cup of coffee in me and fixed other silly stuff.. sorry for the first poor response.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Command line argument
by tadman (Prior) on Jun 03, 2002 at 13:13 UTC |
In Section
Seekers of Perl Wisdom