Hello Monks , How can I a pass more than one word for one option : for example if my script take the option -w , then I want to be able to do somthing like this :
perl myScript.pl -w word1 word2
so word1 and word2 are one argument passed with -w , now I wanted to treat each one seprate.
my code looks like this :
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;}
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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.