Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to escape white space in command line arguments

by nvivek (Vicar)
on Apr 13, 2010 at 06:35 UTC ( #834417=note: print w/ replies, xml ) Need Help??


in reply to How to escape white space in command line arguments

If you want to escape the spaces in the string of an array.You try the following,

my %hash=(1=>"one"); my $str='C:/Program Files/Perl Express/sample.txt'; $str=~s/ /\\ /g; @ARGV = ($str,%hash); system("./script.pl @ARGV");
In the script.pl,I printed the array @ARGV. It printed the Path and hash keys and values correctly.


Comment on Re: How to escape white space in command line arguments
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (16)
As of 2014-07-22 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (126 votes), past polls