Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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.


Comment on Re: Non-destructive array processing
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://229066]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2014-07-24 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (158 votes), past polls