in reply to Printing Map to file

1. if you post code that uses some complex data structures, provide an example, e.g.
my @UnNum = ( [ 0, [1,2,3] ], [ 0, [1,2,3] ]);
2. if you don't understand some code others post here, try to read the perldoc (e.g. perldoc -f map) and then ask again if sth is still unclear.

what this join/map line does (from inner to out):

join ' ', @{$_->[1]}
Simply generate a string with all elements in the second element (u know what i mean ;) ), the arrayref, seperated by blank.
map {"$_->[0]\t " . join ' ', @{$_->[1]}} @UnNum;
now generate an array with the same number of elements like @UnNum. the elements are now a string where the first array element is seperated by a tab from the string generated with join.
print join "\n", map {"$_->[0]\t " . join ' ', @{$_->[1]}} @UnNum;
now generate a string out of this new array, seperated by newline and print it.

if you understand this, then you know the answer to your question.

Replies are listed 'Best First'.
Re^2: Printing Map to file
by Gavin (Archbishop) on Mar 25, 2006 at 23:15 UTC
    That's just what I was hoping for.
    Too often the answers just give a bit of code: no comment! I know it takes a lot longer to comment the code but it makes a big difference to someone like me who is new to programming.
    Thanks again for your time. I now understand what the code was doing.