B
badarisj
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
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