in reply to How to escape white space in command line arguments
This should be re-written. There is no need to "escape" double quotes - the whole path name should be in quotes, this \" doesn't make sense.
Under Windows Perl, the following Perl $path name is completely valid:
#!/usr/bin/perl -w use strict; my $path = "C:/Program Files/Perl Express/example.txt"; #there is no need to "escape" the double quotes. print "$path\n"; my $root = "C:/Program Files/Perl Express"; my $somefile = "X Y Z.dat"; my $somefile_path = "$root/$somefile"; print "$somefile_path\n"; __END__ prints: C:/Program Files/Perl Express/example.txt C:/Program Files/Perl Express/X Y Z.dat
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to escape white space in command line arguments
by GoForIt (Novice) on Apr 13, 2010 at 13:17 UTC | |
by repellent (Priest) on Apr 13, 2010 at 15:34 UTC | |
by Anonymous Monk on Apr 13, 2010 at 15:39 UTC | |
by Marshall (Canon) on Apr 13, 2010 at 20:48 UTC | |
by GoForIt (Novice) on Apr 14, 2010 at 06:24 UTC |