Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] perl hashes



Quoth Neil Bortnak <nbortnak@example.com>:

> The best (only?) way to pass a hash is by using a reference. 

Yes, passing a hash by reference is the best way in many
situations. You can also, however, pass it as a list:

%foo = ( one => 1, two => 2 );

MyFunction %foo;

sub MyFunction {

  my %h = @example.com;
  ...

}

In some cases, this may be preferred. It is a common trick for
object constructors, for one.

-Josh                 


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links