Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Iterating over an array variable times

by ikegami (Patriarch)
on Aug 05, 2008 at 16:15 UTC ( [id://702404]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
       splice(@tmp, $_, 0, 'N') for reverse @positions;
       print(join(',', @tmp), "\n");
    }
    
  2. or download this
    while (my (@positions) = $i->()) {
       my @tmp;
    ...
       push @tmp, @arr[$cur..$#arr];
       print(join(',', @tmp), "\n");
    }
    
  3. or download this
    while (my (@positions) = $i->()) {
       my $sep = '';
    ...
       print($sep, $arr[$cur++]) while $cur < @arr;
       print("\n");
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found