DS has asked for the wisdom of the Perl Monks concerning the following question:
so word1 and word2 are one argument passed with -w , now I wanted to treat each one seprate. my code looks like this :perl myScript.pl -w word1 word2
so I want to pass more than one RELEASE for the -r option and deal with each one ,, I hope this is clear ,,, thanks for help and hints.my $usage = "Usage: $0 -t TARGET -r RELEASE -b BUILDTYPE where: TARGET = {all|esel|esci|sci|btsc|sbc|cn|cis} RELEASE = number + optional buildid for the build BUILDTYPE = {clean|incremental|inc} -- note last two "; my $TARGET=undef; my $RELEASE=undef; my $BUILDTYPE=undef; my $TARGET_FOUND="0"; my $BASEDIR=""; my $DRIVENAME; my $NICE; while(@ARGV){ my $argin = shift; if ($argin =~ /-t/){$TARGET= shift} if ($argin =~ /-r/){$RELEASE=shift} if ($argin =~ /-b/){$BUILDTYPE=shift} } if (( !defined $TARGET ) or ( !defined $RELEASE ) or ( !defined $BUILD +TYPE)) {print $usage;exit;}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing Options
by fruiture (Curate) on Aug 12, 2002 at 14:30 UTC | |
by Abigail-II (Bishop) on Aug 12, 2002 at 15:04 UTC | |
by fruiture (Curate) on Aug 12, 2002 at 15:33 UTC | |
by Abigail-II (Bishop) on Aug 12, 2002 at 15:59 UTC | |
by fruiture (Curate) on Aug 12, 2002 at 21:59 UTC | |
by trs80 (Priest) on Aug 12, 2002 at 17:14 UTC | |
|
Passing multiple arguments to a flag
by Ferret (Scribe) on Aug 12, 2002 at 17:25 UTC | |
by DS (Acolyte) on Aug 12, 2002 at 18:42 UTC | |
|
Re: Passing Options
by tommyw (Hermit) on Aug 12, 2002 at 16:12 UTC |