on Tue, 05 Nov 2002 01:10:51 GMT, [EMAIL PROTECTED] (Jose Malacara)
wrote:
I would like to be able to force them use the
server[number].[location] syntax and generate a warning if they
don't. Would it be possible to add a second argument test after
the first? Something like:
( $#ARGV eq
Hi,
try this :
#!/usr/bin/perl -w
use strict;
sub Usage() {
die Usage: $0 server[number].[location]\n;
}
$_ = shift;
Usage unless ((defined $_) (/^server(\d+)\.(\w+)$/));
print param is $_\n;
---
take a look at perlre.
A+
Jose Malacara a écrit :
I would like to be able to verify the
I would like to be able to verify the presence and syntax of an argument coming into
my script prior to actually doing anything with it. My script is execpting to see
something like this
../myscript server10.boston
or
../myscript server30.california
I am able to check for the presense of an