Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: printing every 2nd entry in a list backwards

by tobyink (Canon)
on May 19, 2017 at 16:56 UTC ( [id://1190652]=note: print w/replies, xml ) Need Help??


in reply to Re^2: printing every 2nd entry in a list backwards
in thread printing every 2nd entry in a list backwards

Well, it necessitates using a block, and the block form of grep is a little slower than the expression form.

grep { BLOCK } @list; # slow grep EXPRESSION, @list; # fast

But it's not just that. Even if you make them both use the block form of grep, state comes out behind my. I guess they've just put a lot of work into optimizing how fast normal lexical variables work, and less work into state variables.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-23 07:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found