my $type="w"; &print_summary; sub print_summary { if($type=~/w/) { print "hello\n"; } }