Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 chanting in the Monastery: (7)
As of 2017-05-28 12:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?