in reply to Printing Map to file
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.my @UnNum = ( [ 0, [1,2,3] ], [ 0, [1,2,3] ]);
what this join/map line does (from inner to out):
Simply generate a string with all elements in the second element (u know what i mean ;) ), the arrayref, seperated by blank.join ' ', @{$_->[1]}
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.map {"$_->[0]\t " . join ' ', @{$_->[1]}} @UnNum;
now generate a string out of this new array, seperated by newline and print it.print join "\n", map {"$_->[0]\t " . join ' ', @{$_->[1]}} @UnNum;
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 |