Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Clever map / foreach algorithm sought

by bmcatt (Friar)
on May 03, 2002 at 13:53 UTC ( #163786=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2022-05-23 16:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (82 votes). Check out past polls.

    Notices?