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

Re: Clever map / foreach algorithm sought

by Sidhekin (Priest)
on May 03, 2002 at 14:02 UTC ( #163787=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @x = (4, 4, 2);
    my $pref = 'XX';
    
    my @y = map {my $chunk=$_; map{sprintf("$pref%02d:",$chunk).$_}1..$x[$
    +chunk-1]}1..@x;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2022-05-26 05:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (93 votes). Check out past polls.

    Notices?