in reply to Re^2: printing all elements of arrays
in thread printing all elements of arrays

what does the print map state?

Okay,

print join("\n", @array), "\n";
says "Stick a newline between each element in @array, return that as a string, print it, and print a newline at the end." On the other hand,
print map {$_ . "\n"} @array;
says "Build a list whose elements are the elements of @array with "\n" appended to them, then print that list."

what perldoc can I read about the map call?

You can read about any function with perldoc -f func_name.

--
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^4: printing all elements of arrays
by beable (Friar) on Jul 13, 2004 at 02:00 UTC

    Here is another way to print the elements of an array on separate lines, using the $, variable (see perlvar:

    #!/usr/bin/perl use strict; use warnings; my @array = (1..10); local $, = "\n"; print @array;