Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Ouch! Each! Reentrant it is not

by ysth (Canon)
on Jul 15, 2005 at 09:16 UTC ( #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
Node Status?
node history
Node Type: note [id://475149]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2020-06-01 06:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?