in reply to Choosing regex delimiters

I changed the double-quotes to single-quotes and got a reasonable result. Which to me suggests that the shell does some processing with double-quoted strings before it reaches perl

Whatever shell you are using, try this:

> echo 'hello $1' hello $1 > echo "hello $1" hello

Replies are listed 'Best First'.
Re^2: Choosing regex delimiters
by JavaFan (Canon) on Feb 06, 2009 at 16:42 UTC
    Which to me suggests that the shell does some processing with double-quoted strings before it reaches perl
    That depends on the shell. Typically, Unix shells with do interpolation (including `` expanding) inside double quoted strings, and no interpolation inside single quoted string.

    It's my understanding that you only have double quoted strings on most Windows shells (not counting shells that started life on Unix, then got ported). No idea whether they do interpolation or not.

      Naturally. Not knowing the shell he uses I gave him a pointer where to look. Probably should have said 'my shell' instead of 'the shell'.

      Whatever shell he is using, there should be a mechanism to avoid interpolation, often single quotes or generous use of backward slashes. Do backward slashes work on windows? I never checked.

        Whatever shell he is using, there should be a mechanism to avoid interpolation
        That's only needed if said shell actually does have interpolation ;-)