NaSe77 has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Escaping characters on win2000's cmd.exe
by PodMaster (Abbot) on Aug 22, 2002 at 12:20 UTC | |
by NaSe77 (Monk) on Aug 22, 2002 at 12:25 UTC | |
|
Re: Escaping characters on win2000's cmd.exe
by JupiterCrash (Monk) on Aug 22, 2002 at 13:08 UTC |