use strict; sub print_summary { if ($type =~ /w/) { print "Hello\n"; }; }; my $type = "w"; print_summary;