in reply to How to determine if a sub is defined in a package, without calling it?
You can use defined:
perl -wMstrict -E 'sub blah{}; say defined &blah' 1 perl -wMstrict -E 'say defined &blah'
Or, in another package:
perl -wMstrict -E 'package X;{sub blah{}} say defined &X::blah' 1
|
|---|