Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^7: about style: use possessive or atomic?

by BrowserUk (Patriarch)
on Aug 16, 2015 at 13:41 UTC ( [id://1138744]=note: print w/replies, xml ) Need Help??


in reply to Re^6: about style: use possessive or atomic?
in thread about style: use possessive or atomic?

I get the same warning with Strawberry Perl v5.20.2, but not on v5.18.2.

You're right! My default perl is currently 5.18:

C:\test>\perl5.18\perl\bin\perl.exe junk37.pl SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS C:\test>\Perl5.20\bin\perl.exe junk37.pl Useless use of greediness modifier '+' in regex; marked by <-- HERE in + m/((?:a|b)){1}+ <-- HERE / at junk37.pl line 15, <DATA> line 2. SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS C:\test>\Perl22\bin\perl.exe junk37.pl Useless use of greediness modifier '+' in regex; marked by <-- HERE in + m/((?:a|b)){1}+ <-- HERE / at junk37.pl line 15, <DATA> line 2. SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS
Is the warning erroneous?

Erm. I was relying on Perl to tell me :)

The fact that the warning has been recently added suggests it is probably correct.

That said, the construct is still listed in the 5.22 docs:  {n}+   Match exactly n times and give nothing back (redundant); which basically means your guess is as good as anybody's at this point?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!

Replies are listed 'Best First'.
Re^8: about style: use possessive or atomic?
by Athanasius (Archbishop) on Aug 16, 2015 at 14:13 UTC

      That absolutely makes sense, and I like when warnings like this get added. Any time someone can be warned whenever they are trying to use something useless is another tool that will potentially help someone who's trying to debug something they don't understand: "I'm using a quantifier, but why the heck isn't it working!".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-24 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found