Is there a reason you insist on using 'map'? An explicit 'for' loop would be more legible. Not that I dislike 'map', but once past a certain degree of complexity, you really should break it out.
#!/usr/bin/perl -wl use strict; print for map { y/[]//d; join " ", reverse split } <DATA>; __DATA__ w1 w2 w3 [t4 w4] w5
Update: My assumption is the opposite of netwallah's, since 'map' would print an arrayref as 'ARRAY(0xDEADBEEF)' rather than '[foo bar]'.
-- Human history becomes more and more a race between education and catastrophe. -- HG Wells
In reply to Re: printing array using map
by oko1
in thread printing array using map
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |