What this does is creating a hash that looks like this:

%hash {
      $array[0] => 1,
      $array[1] => 1,
      $array[2] => 1,
      $array[3] => 1,
      ect.
     }

It is a (posibly the quickest way) of changing a array into a hash.

Hope it helps.


On 9/13/06, chen li <[EMAIL PROTECTED]> wrote:

Hi all,

In perlfaq4.pod I see one line:

my %hash   = map { $_, 1 } @array;

What is the usage of 1 in this code?


Thanks,

Li

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Reply via email to