in reply to [SHELL] Detect backslash in command line args

You might try this:

$ perl -e 'die "error: @ARGV[0]" if @ARGV[0] =~ /\\/' foo\\bar error: foo\bar at -e line 1.

Replies are listed 'Best First'.
Re^2: [SHELL] Detect backslash in command line args
by syphilis (Archbishop) on Jul 08, 2013 at 23:48 UTC
    perl -e 'die "error: @ARGV[0]" if @ARGV[0] =~ /\\/' foo\\bar

    That works, but passing 'foo\\bar' is not an error.
    The error I want to catch is when I pass 'foo\bar'.

    Cheers,
    Rob

      Then it is a shell issue, not a Perl issue.

        Then it is a shell issue, not a Perl issue.

        And the OP wants to detect/handle it from-a perl program, makes it Perl issue, cause perl like interacts with shells