Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: No need to escape right brace in regex

by syphilis (Archbishop)
on Oct 21, 2014 at 10:21 UTC ( [id://1104553]=note: print w/replies, xml ) Need Help??


in reply to Re: No need to escape right brace in regex
in thread No need to escape right brace in regex

Yes, I'm on Windows. I think you really need to stick with single quotes on Ubuntu, otherwise things get a bit weird with the setting and interpolation of $_.
The Windows shell doesn't interpolate on the "$" sign - as "$" isn't meaningful on Windows like it is on Linux.

On my Ubuntu-14.04 with perl-5.18.0, the first time I run the command quoted above, it's fine.
But after that I get errors too.
sisyphus@sisyphus5-desktop:~$ echo $_ PATH $ perl -le "$_=~/sub mymy\{}/;" # No error here $ echo $_ PATH=~/sub mymy\{}/; $ perl -le "$_=~/sub mymy\{}/;" Backslash found where operator expected at -e line 1, near "mymy\" syntax error at -e line 1, near "mymy\" Execution of -e aborted due to compilation errors.
The actual error messages can vary a bit, depending upon what gets run when - but I've seen the same error as you reported.

Cheers,
Rob

Replies are listed 'Best First'.
Re^3: No need to escape right brace in regex
by WHUK (Initiate) on Oct 21, 2014 at 11:28 UTC
    That's right. The Windows shell does not apply on the "$" sign and is not significant on Windows as it is usually with Linux.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1104553]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-19 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found