parsing command line args
- From: "badarisj@xxxxxxxxx" <badarisj@xxxxxxxxx>
- Date: 29 Oct 2006 16:03:30 -0800
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)
0 '-arg1'
1 '-arg2'
2 '-arg3'
3 'value with spaces'
now if i have a string for the command-line:
$cmd_str = "/tmp/test.pl -arg1 -arg2 -arg3 'value with spaces'" ;
any ideas on parsing the $cmd_str into a @ARGV array i have shown
above?
thanks,
-badari
.
- Follow-Ups:
- Re: parsing command line args
- From: Ben Morrow
- Re: parsing command line args
- Prev by Date: Re: How do I do full access logging including HTTP headers?
- Next by Date: Re: Looking for a lightweight GUI editor on Windows
- Previous by thread: How do I do full access logging including HTTP headers?
- Next by thread: Re: parsing command line args
- Index(es):
Relevant Pages
|