Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Non-destructive array processing

by Aristotle (Chancellor)
on Jan 22, 2003 at 16:16 UTC ( #229066=note: print w/replies, xml ) Need Help??


in reply to Non-destructive array processing

Life is not a JAPH contest.
sub make_get_pairs { my $alias = \@_; sub { splice @$alias, 0, 2 } } my @foo = 1..10; my $get_foo_pair = make_get_pairs(@foo); while (my @chunk = $get_foo_pair->()) { print "Chunk: @chunk\n"; } print "\@foo is still intact: @foo\n";

Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://229066]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2016-12-05 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (71 votes). Check out past polls.