zuma53 has asked for the wisdom of the Perl Monks concerning the following question:
Hi--
This is probably a no-brainer, but it is something I'm not seeing. I had posted a question on PM, and got a solution (Thanks, Monks!). It works fine on Windows, but when I try running it on a Mac, it errors out.
$stripped = $select =~ s/ ( ' .*? ' ) /'_' x length $1/egrx;
Bareword found where operator expected at x.pl line 942, near "s/ /'_' x length $1/egrx" syntax error at x.pl line 942, near "s/ /'_' x length $1/egrx"
On the left side of the regex, I want to look for single quotes. The single quotes on the right side is for the repeat operator (right?). I've tried escaping them to no avail (though I think doing that means something else in the regex entirely).
Why is this malformed only on a Mac?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bareword found error on MacOS
by Fletch (Bishop) on Aug 30, 2012 at 14:11 UTC | |
by zuma53 (Beadle) on Aug 31, 2012 at 05:40 UTC | |
by zuma53 (Beadle) on Aug 30, 2012 at 14:18 UTC | |
by Anonymous Monk on Aug 30, 2012 at 14:19 UTC | |
|
Re: Bareword found error on MacOS
by bitingduck (Deacon) on Aug 30, 2012 at 15:25 UTC |