[Pdx-pm] Hash reference depricated..
Tom Heady
pdxpm at punch.net
Tue Oct 17 17:14:01 PDT 2006
Russ Johnson wrote:
> From what I can see, the two routines here produce the same result.
>
> for my $key ( keys %$DATA ) {
> my $value = %$DATA->{$key};
You probably want:
my $value = $DATA->{$key};
> print OUTFILE "$key => $value\n";
> }
>
> while ( my ($key, $value) = each(%$DATA) ) {
> print OUTFILE "$key => $value\n";
> }
>
> Except, the first one results in "Using a hash as a reference is
> deprecated at ./script.pl line 85." The second runs without errors.
>
> Anyone see why?
>
More information about the Pdx-pm-list
mailing list