Re: parsing command line args
- From: Tad McClellan <tadmc@xxxxxxxxxxxxxx>
- Date: Sun, 29 Oct 2006 19:36:49 -0600
Ben Morrow <benmorrow@xxxxxxxxxxxxx> wrote:
Quoth "badarisj@xxxxxxxxx" <badarisj@xxxxxxxxx>:
folks,
when i give a command-line of:
/tmp/test.pl -arg1 -arg2 -arg3 'value with spaces'
to unix-shell, my perl script has access to the command-line arguments
in the following neat array:
0 ARRAY(0x12b06c)
I'm not quite sure what you intended to mean by this line: for a start,
@ARGV certainly doesn't have two 'element 0's.
That's what caused me to not attempt an answer when I saw it.
The Text::ParseWords module will do this for you. I was fairly sure this
was in the FAQ, but a couple of reasonable searches didn't find it,
perldoc -q split
How can I split a [character] delimited string except when inside [character]?
--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas
.
- References:
- parsing command line args
- From: badarisj@xxxxxxxxx
- Re: parsing command line args
- From: Ben Morrow
- parsing command line args
- Prev by Date: Re: Naive threading performance questions
- Next by Date: Re: parsing command line args
- Previous by thread: Re: parsing command line args
- Next by thread: Re: parsing command line args
- Index(es):
Relevant Pages
|
|