in reply to \" on the WinXP Command Line

That said, - if you want 2 parameters passed in, with a trailing '\', try passing the params as '"A A\\" B"':
>perl -e "foreach (@ARGV){print qq('$_'\n);}" "A A\\" B" 'A A\' 'B'
perl never gets a chance to parse the escaped "\" - that is done by the cmd interpreter.

Update: Aah - learned something today - there is a backdoor way to get the args after all! .. see nodes below.

"Experience is a wonderful thing. It enables you to recognize a mistake when you make it again."

Replies are listed 'Best First'.
Re: Re: \" on the WinXP Command Line
by Ardemus (Beadle) on Feb 25, 2004 at 21:34 UTC
    I'm sorry, I'm expecting all arguments (even those ending with a backslash) to be parsed as they are in example B.

    As John comments a little later: this is an issue with how Perl handles standard Windows command line arguments (the goal was to avoid deviating from that standard syntax).

    I am looking for Perl based solutions (like the one that John provided). Is this the incorrect forum for that type of question? I'm new to the Perl Monks, so I applogize if I chose the wrong forum.

    Thanks