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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|