Thanks for the advice guys, both are things that will help
matt
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 10:54 AM
To: Matthew Thompson
Cc: activeperl
Subject: deleting hash values
Matthew Thompson writes:
> Hi,
&g
Matthew Thompson writes:
> Hi,
> I'm using the following code to delete values from a hash - I get the
> warning (I say warning as it does delete the value) below when delete is
> called. Is ther a better way of deleting values from hashes?
>
> foreach $item (%$self) {
>
I would use a sub hash
$Users{ User2 }{ Location } = .. ;
$Users{ User2 }{ Lastname } = .. ;
$Users{ User1 }{ Location } = .. ;
Then you can say
delete $Users{ $Section } ;
and avoid the looping.
You also get the added benefit of simpler database management if your
fetching / pushing to sql.
Hi,
I'm using the following code to delete values from a hash - I get the
warning (I say warning as it does delete the value) below when delete is
called. Is ther a better way of deleting values from hashes?
foreach $item (%$self) {
if ($item=~/^$section\.(.*)/) {