#!/usr/bin/perl -w use strict; my $hash_ref2={ this=>'that', some=>'thing', another=>'something', }; my $hash_ref1={ this=>'blarney', some=>'foo', chancy=>'at best', }; my @a=($hash_ref1,$hash_ref2); print "this is ".$$hash_ref2{'this'}."\n"; my $var='$$hash_ref{\'this\'} eq \'that\''; foreach my $hash_ref(@a){ if($$hash_ref{'this'} eq 'that'){ print "I only want to see case where: \"this really does equal ".$$hash_ref{'this'}."\"\n"; } if("$var"){ print "this really does equal ".$$hash_ref{'this'}."\n\n"; } }