Re: Problem with subroutines with hash and var as input

2004-10-02 Thread Edward Wijaya
On Sat, 02 Oct 2004 01:46:01 -0700, John W. Krahn <[EMAIL PROTECTED]> wrote: there is an extra $ in there, it should be: 67: delete $HoH->{ $k } if keys %{ $HoH->{ $k } } < $limit; Thanks a lot John. Now it's ok. RegardS, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: Problem with subroutines with hash and var as input

2004-10-02 Thread John W. Krahn
Edward Wijaya wrote: On Fri, 01 Oct 2004 08:58:44 -0700, John W. Krahn <[EMAIL PROTECTED]> wrote: Since $HoH now contains a reference to a hash you have to dereference it properly. delete $HoH->{ $k } if keys %${ $HoH->{ $k } } < $limit; return %$HoH; I apologize for insisting John.

Re: Problem with subroutines with hash and var as input

2004-10-01 Thread Edward Wijaya
On Fri, 01 Oct 2004 08:58:44 -0700, John W. Krahn <[EMAIL PROTECTED]> wrote: Since $HoH now contains a reference to a hash you have to dereference it properly. delete $HoH->{ $k } if keys %${ $HoH->{ $k } } < $limit; return %$HoH; I apologize for insisting John. Tried as you sugges

Re: Problem with subroutines with hash and var as input

2004-10-01 Thread John W. Krahn
Edward Wijaya wrote: On Fri, 01 Oct 2004 07:41:43 -0700, John W. Krahn <[EMAIL PROTECTED]> wrote: Either put the scalar first in the list or pass a reference to the original hash. Now, I also tried with pass by reference my ($HoH,$limit) = @_; foreach my $k ( keys %$HoH ) {

Re: Problem with subroutines with hash and var as input

2004-10-01 Thread Edward Wijaya
On Fri, 01 Oct 2004 07:41:43 -0700, John W. Krahn <[EMAIL PROTECTED]> wrote: Thanks, No need for $count or the second for loop: John, your one-liner certainly makes my sub looks better. Either put the scalar first in the list or pass a reference to the original hash. Now, I also tried with pass b

Re: Problem with subroutines with hash and var as input

2004-10-01 Thread John W. Krahn
Edward Wijaya wrote: Dear Sirs, I have the following code, that take Hash of Hash as an iput. Then I have function (see below) that takes a hash and a variable as input. This function will count the elements of secondary hashes and delete the hash, if it is below certain variable limit. So with thi

Re: Problem with subroutines with hash and var as input

2004-10-01 Thread Wiggins d Anconia
> Dear Sirs, > > I have the following code, that > take Hash of Hash as an iput. > > Then I have function (see below) that takes > a hash and a variable as input. > This function will count the elements > of secondary hashes and delete the hash, > if it is below certain variable limit. > > So wi

Problem with subroutines with hash and var as input

2004-10-01 Thread Edward Wijaya
Dear Sirs, I have the following code, that take Hash of Hash as an iput. Then I have function (see below) that takes a hash and a variable as input. This function will count the elements of secondary hashes and delete the hash, if it is below certain variable limit. So with this : my %new_hoh = red