in reply to printing all elements of arrays
(I)s there any way to print all the elements of any array instead of referencing each element like so [0], [1], [2] ...etc?
If you want to print out each element of an array on its own line,
is probably the easiest way to do it. If the extra "\n" offends you,print join("\n", @array), "\n";
will do much the same thing, but it's less idiomatic (I think).print map {$_ . "\n"} @array;
--
F
o
x
t
r
o
t
U
n
i
f
o
r
m
Found a typo in this node? /msg me
% man 3 strfry
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: printing all elements of arrays
by ysth (Canon) on Jul 13, 2004 at 01:17 UTC | |
|
Re^2: printing all elements of arrays
by drock (Beadle) on Jul 13, 2004 at 01:26 UTC | |
by FoxtrotUniform (Prior) on Jul 13, 2004 at 01:32 UTC | |
by beable (Friar) on Jul 13, 2004 at 02:00 UTC | |
by ysth (Canon) on Jul 13, 2004 at 01:30 UTC | |
by beable (Friar) on Jul 13, 2004 at 01:40 UTC |