http://www.perlmonks.org?node_id=181168


in reply to Random Tips on Parse::RecDescent

Useful compilation, but you can go back and reenable strict 'refs'.
#!/usr/bin/perl -w use strict; for (qw(foo bar)) { ($main::{$_} or sub { print "No such sub: $_\n" })->(); } sub foo { print "Yes, I'm here.\n"; } __END__ Yes, I'm here. No such sub: bar
Alternatively: (UNIVERSAL::can('main', $sub) or sub { print "No such sub: $_\n" })->();
____________
Makeshifts last the longest.