The shell doesn't act very different to double-quoted strings in Perl.
You have a misconception here
> With MS Windows's cmd.exe shell we can force an exception if any args passed via the command line contain a backslash:
the same with Unix, just
> So ... if someone does perl script.pl arg\one in one of these shells, is there any way that script.pl can detect the backslash contained in that command line argument ?
In your example you are not passing a backslash, just an escaped "o", which is most probably just a simple "o"¹. To be able to pass a backslash you need to double it!!!
Cheers Rolf
( addicted to the Perl Programming Language)
¹) yep
lanx@nc10-ubuntu:~$ perl -le 'print ord(chomp($ARGV[0]))' \o 48 lanx@nc10-ubuntu:~$ perl -le 'print ord(chomp($ARGV[0]))' o 48
In reply to Re: [SHELL] Detect backslash in command line args
by LanX
in thread [SHELL] Detect backslash in command line args
by syphilis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |