if ($x{owns}{$y} && $thing{$y}{value}>20) { print "The badguy will steal $x\'s $y.\n"; } if ($item{value} > 20) { print "The badguy will steal from $potentialvictim\n"; } if ( $(any(@{$x->{owns}})){value} > 20) { print "badguy will steal from $x\n"; } $isvaluable = sub ($) { my $x=shift; $x->{value} > 20 ? 0 : 1; };