i have written a little code to make the problem more obvious:
use strict; use warnings; my $string1 = " koisqd / \ poqsdpo .posd"; my $string2 = " koisqd / \ poqsdpo .posd"; my $string3 = " koisqd / \ poqsdpo .posd"; foreach my $toEscape ($string1, $string2, $string3){ $toEscape =~ s/(\s|\\|\/)/\\$1/g; } system("perl hear.pl $string1 $string2 $string3");
wich gives me:use strict; use warnings; my $i = 1; foreach my $arg (@ARGV){ print "$i\t: $arg\n"; $i++; }
instead of just 3 arguments...1 : \ 2 : koisqd\ 3 : \/\ 4 : \ 5 : poqsdpo\ 6 : .posd 7 : \ 8 : koisqd\ 9 : \/\ 10 : \ 11 : poqsdpo\ 12 : .posd 13 : \ 14 : koisqd\ 15 : \/\ 16 : \ 17 : poqsdpo\ 18 : .posd
please help me
----
NaSe
:x
In reply to Escaping characters on win2000's cmd.exe by NaSe77
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |