Not as cool as His Royal Cheeziness' or larsens, but useful:
#!/usr/bin/perl -wl use strict; my @ASHT = map { my @ash = 'a' .. 'h'; for my $as(@ash) { $as .= $_; } @ash; # implicit return } 1 .. 8; print join ',',@ASHT; my @ASH2 = map { $a = $_; map( $_.$a, 'a' .. 'h' ) } 1 .. 8; print join ',',@ASH2; print "BETTER WAY"; my @ASH3 = map { $a = $_; [ map( $_.$a, 'a' .. 'h' ) ] } reverse (1 .. 8); for my $i ( 0 .. 7 ) { print 8 - $i, "{", join( ',', @{ $ASH3[$i] } ), "}"; } print join ' ','','a'..'h'; #print Dumper \@ASH3; # if you're confused __END__ a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h +3,a4,b4,c4,d4,e4,f4,g4,h4,a5,b5,c5,d5,e5,f5,g5,h5,a6,b6,c6,d6,e6,f6,g +6,h6,a7,b7,c7,d7,e7,f7,g7,h7,a8,b8,c8,d8,e8,f8,g8,h8 a1,b1,c1,d1,e1,f1,g1,h1,a2,b2,c2,d2,e2,f2,g2,h2,a3,b3,c3,d3,e3,f3,g3,h +3,a4,b4,c4,d4,e4,f4,g4,h4,a5,b5,c5,d5,e5,f5,g5,h5,a6,b6,c6,d6,e6,f6,g +6,h6,a7,b7,c7,d7,e7,f7,g7,h7,a8,b8,c8,d8,e8,f8,g8,h8 BETTER WAY 8{a8,b8,c8,d8,e8,f8,g8,h8} 7{a7,b7,c7,d7,e7,f7,g7,h7} 6{a6,b6,c6,d6,e6,f6,g6,h6} 5{a5,b5,c5,d5,e5,f5,g5,h5} 4{a4,b4,c4,d4,e4,f4,g4,h4} 3{a3,b3,c3,d3,e3,f3,g3,h3} 2{a2,b2,c2,d2,e2,f2,g2,h2} 1{a1,b1,c1,d1,e1,f1,g1,h1} a b c d e f g h

 
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void

perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"


In reply to (crazyinsomniac) Re: Filling an array. (Golf challenge?) by crazyinsomniac
in thread Filling an array. (Golf challenge?) by gmax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.