Re: hash key with a regexp

2001-02-20 Thread SCOTT_SISSON
Here is something q&d (quick & dirty) that can be a start and can probably be done more elegantly. Scott while () { chomp; # eliminate \n ($v1,$v2) = split /\,/; #get variables next unless ($_);#skip blank lines $hash{$v1}++;# incr

RE: hash key with a regexp

2001-02-20 Thread Joseph P. Discenza
Greg Wardawy wrote, on Tuesday, February 20, 2001 15:22 : Hello all, Is it correct to say: print if $var1 == $hash{$key =~ : /$var2\d+/}; or: print if $var1 == $hash{$key\d+}; if I need a : conditional print for all keys of the hash which starts with : $var2? The reason I'm asking is that I hav