In the 2nd case your addressing your hash as a hash REFERENCE, which makes a
big difference

i suggest you read up on references at
http://language.perl.com/newdocs/pod/perlreftut.html

either way, your first method works fine and should work in most cases.
however, if you want to pass said hash to subroutines, you might want to
concider using references instead.

Regards,

Jos Boumans

----- Original Message -----
From: "Craig Moynes/Markham/IBM" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 04, 2001 8:15 PM
Subject: Hash help


> First sorry for asking this, I only keep select emails from this list and
> couldn't find an answer among them.
>
> I declare my hash like this:
>
> my ( %FS_XCPTN );               # hash table, key is mount point,
>                                 # value is FS's special case H_LIMIT and
> C_LIMIT
>
> I use it like this:
>                                 $FS_XCPTN{$mntPoint} = {
>                                         H_LIMIT => "$l_limit",
>                                         C_LIMIT => "$h_limit" };
>
> And keys returns the list correctly.  But when I use it like this:
>
>                                 $FS_XCPTN->{$mntPoint} = {
>                                         H_LIMIT => "$l_limit",
>                                         C_LIMIT => "$h_limit" };
>
> And run the keys on it, it doesn't seem to work.   What am I doing wrong ?
> -----------------------------------------
> Craig Moynes
> Internship Student
> netCC Development
> IBM Global Services, Canada
> Tel: (905) 316-3486
> [EMAIL PROTECTED]
>
>
>

Reply via email to