Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://549800]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-19 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found