use strict; my $sum; unless (defined($sum)) { print '$sum is undefined', "\n"; } else { print 'The value of $sum is ', "$sum\n"; }