Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Bareword found error on MacOS

by bitingduck (Chaplain)
on Aug 30, 2012 at 15:25 UTC ( #990785=note: print w/ replies, xml ) Need Help??

in reply to Bareword found error on MacOS

Seems to work fine for me on a mac running 5.16.0

#!/usr/bin/perl # use strict; use warnings; my $select="this isn't a'regular 'expression"; print $select."\n"; my $stripped = $select =~ s/ ( ' .*? ' ) /'_' x length $1/egrx; print $stripped."\n"; print $1."\n"; print $select."\n";
And gives me:
this isn't a'regular 'expression this isn_____regular 'expression 't a' this isn't a'regular 'expression

Edit Also works fine under 5.14.2

Another Edit Are you sure you're running the right perl version on the mac? If it's picking the perl from the shebang then you could be using the system perl, where you want to use different one (e.g. installed via perlbrew). In my two tests above I ran it with perl so it would use the perlbrew versions. If I run it with ./ it uses the system install of 5.12.3 and I get your bareword error.

Comment on Re: Bareword found error on MacOS
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2015-11-28 16:56 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls