use strict; use warnings; sub foo { print 'foo\n'; } sub bar { print 'bar\n'; } my $var = 'foo'; # invoke sub foo __END__