Alternatively: (UNIVERSAL::can('main', $sub) or sub { print "No such sub: $_\n" })->(); ____________#!/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
In reply to Re: Random Tips on Parse::RecDescent
by Aristotle
in thread Random Tips on Parse::RecDescent
by hsmyers
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |