Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Command Line Options without "-" or "- -"

by Smaug (Pilgrim)
on May 16, 2006 at 15:28 UTC ( [id://549800] : note . print w/replies, xml ) Need Help??


in reply to Command Line Options without "-" or "- -"

Ok..... Sorry!!! I got it working by doing this:
while (<@ARGV>) { my $arg = shift @ARGV; @options = split(/: /,$arg); print "XXXXXXXX\t", $options[$_], "\tXXXXXXXX"; }

But it still does not help me with the ": " being in the data sometimes.

Thanks.

Replies are listed 'Best First'.
Re^2: Command Line Options without "-" or "- -"
by suaveant (Parson) on May 16, 2006 at 16:03 UTC
    If you have a space after the token, and your value is in quotes, the shell should separate them and put each one in a different item of ARGV.... it looks like you have that space, but I could be wrong.

    Regardless, split takes an optional third argument which limits how many array items are returned. So put a 2 at the end of your split.

                    - Ant
                    - Some of my best work - (1 2 3)