Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Ouch! Each! Reentrant it is not

by ysth (Canon)
on Jul 15, 2005 at 09:16 UTC ( [id://475149]=note: print w/replies, xml ) Need Help??


in reply to Ouch! Each! Reentrant it is not

This reminds me of a similar issue with scalar glob, only there there's no remedy but to use list-context instead:
$ perl -wle' sub glob_limit { my ($pat, $max) = @_; my $i; print "pattern: $pat"; while ($val = glob($pat)) { print $val; last if ++$i == $max; } } glob_limit("{a,b,c}", 2); glob_limit("{p,d,q}", 3); ' pattern: {a,b,c} a b pattern: {p,d,q} c

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://475149]
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: (None)
    As of 2024-04-25 00:00 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found