Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Non-destructive array processing

by Aristotle (Chancellor)
on Jan 22, 2003 at 16:16 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://229066]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-23 20:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found