#!/usr/bin/perl %hash = qw(first David last Sherrill); $check_first = exists $hash{"first"}; $check_age = exists $hash{"age"}; # "false" doesn't show up as a 0 unless "forced" $num = ( $check_age == 0 ) ? 0 : 1; print "Does first exist? $check_first\n"; # Does first exist? 1 print "Does age exist? $check_age\n"; # Does age exist? print "variable num = $num\n"; # variable num = 0