in reply to Re: How to reference to array keys?
in thread How to reference to array keys?

RE: What is the purpose of the "map" function on an array?

In this code:

@array = map { my ($file, $recordID, $M, $owner, $pid, $userID, $tty, +$time, $month, $day, $locker) }= split;
The map does absolutely nothing useful at all! I'm actually not quite sure that it even works at all.
Anyway it is not needed here.
@array = my ($file, $recordID, $M, $owner, $pid, $userID, $tty, $time, + $month, $day, $locker) = split;
map{} is most often used for data transformation. Read map. @output = map{some code}@input; is a typical usage. Each element of @input enters the map as $_. Some processing is done. The return value which passes to the left into @output is whatever the last line of the map code evaluates to. There is no need for a "return" statement.