Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Bareword found error on MacOS

by bitingduck (Friar)
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 # bareword.pl 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 bareword.pl so it would use the perlbrew versions. If I run it with ./bareword.pl 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2014-08-29 21:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (289 votes), past polls