On Tue, May 20, 2008 at 10:42 PM, psykx.out <[EMAIL PROTECTED]> wrote:
>
> Hey I'm getting this error
>
> Useless use of hash element in void context at ./three.pl line 97.
>
> I have googled it and found that I am probably treating a scalar like a
> hash reference but I can't see where. below is the offending lines
>
> 90    if( defined $thash{$k[$key]} ){
> 91    $n = $result;
> 92    while( !defined $high ){
> 93            $n++;
> 94        if ( ${$thash}{$k[$key]}{$j} => $result ){

Do you mean >= ? # greater than or equal

You can also write this,

if (defined (my $whatever= $thash{$k[$key]})) {
# ...
if ($whatever->{$j} >= $result) {

Clearer & quicker.

> 95                $high = ${$thash}{$k[$key]}{$j};
> 96            }
> 97    }
>
> Yes those are the correct line numbers I think I just have sooo many
> errors. $thash is a reference to a multidimensional hash (2D), $key is
> an int and $k is an array reference.
>
> Cheers max
>
> p.s this isn't for work
> _______________________________________________
> BristolBathPM mailing list
> [email protected]
> http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm
_______________________________________________
BristolBathPM mailing list
[email protected]
http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm

Reply via email to