sub foo { print "yep\n"; } @foo = $foo = 'a string'; my $f = 'foo'; foo() if defined &foo; undef &$f; print "nope\n" unless defined &foo; print "\$foo: $foo\n"; print "\@foo: @foo\n"; __output__ yep nope $foo: a string @foo: a string