Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^5: (Mis)Understanding grep...eq $_ (versus ex-bang-bang)

by grinder (Bishop)
on Feb 24, 2009 at 23:39 UTC ( #746143=note: print w/replies, xml ) Need Help??

in reply to Re^4: (Mis)Understanding grep...eq $_ (versus ex-bang-bang)
in thread (Mis)Understanding grep...eq $_


I dare say the ex-bang-bang approach is faster, but then I would be rightly accused of premature optimisation. The grep approach, while slower (but at a cost approaching zero) is more easily figured out from first principles.

The effect of x!! is not easily discerned; one has to write a harness to explore its behaviour. Either because one has encountered a similar idiom in a different language and wants to see if Perl matches expectations based on prior experience, or else they have not the faintest idea of what it does (and once one sees what it does, can they determine why?)

So in summary, there is a difference. One is tricksy, the other is merely degenerate.

• another intruder with the mooring in the heart of the Perl

  • Comment on Re^5: (Mis)Understanding grep...eq $_ (versus ex-bang-bang)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://746143]
[shmem]: No, not coincidence - prejudice and bias
[shmem]: your scanner is pre-loaded ;-)
[shmem]: anyways, do as is your wont. I won't fight western hypocresy anymore - for today. Let's call that a day, and done.
[erix]: yeah, scanning pre-loaded. I wouldn't have it any other way. As I say, my attention is a rare commodity, jealously guarded.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-03-19 21:10 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.