Re: Perl Hash of arrays : comparison

2006-03-21 Thread John W. Krahn
Sonika Sachdeva wrote: > Hi, Hello, > I have Hash of array. I want to compare the array values within the hash. > How can it be done? > > if ($eline =~ /$pattern/ ) { > $eline =~ /(.*)\"(\w+)\s(.*)\?(.*)\"/ ; my $uniq=$1; my > $url=$4; You shouldn't use the numerical variables i

Re: Perl Hash of arrays : comparison

2006-03-21 Thread Mr. Shawn H. Corey
Sonika Sachdeva wrote: I have Hash of array. I want to compare the array values within the hash. How can it be done? if ($eline =~ /$pattern/ ) { $eline =~ /(.*)\"(\w+)\s(.*)\?(.*)\"/ ; my $uniq=$1; my $url=$4; chomp($uniq);chomp($url); my @var= (

RE: Perl Hash of arrays : comparison

2006-03-21 Thread Timothy Johnson
You need to dereference the array at $var{$key} in a similar way to the way you did it when you created the array, so something like this should work: foreach my $key(keys %VAR){ foreach my $element(@{$VAR{$key}}){ #do something... } } -Original Message- From: Sonika Sachdeva