Anant Gupta wrote:
> ..
> use strict;
> ..
>
> my %hash;
> my $abc;
> my $count;
> while(defined($ARGV[$count]))
> {
> push(@hash{$abc},$ARGV[$count]);
> }
>
> Can't i use this
>
> The error is "Type of arg 1 must be array not hash element ..."
@hash{$abc} is a hash slice. You probably want @{$hash{$abc}}.
John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity. -- Damian Conway
Thread Previous