Apart from using can (which is a great way), you can also do:
package A; sub b { print "called A::b\n"; } package main; my $pack='A'; { no strict 'refs'; &{"${pack}::b"}(); }
That is, creating a soft-ref to the sub on-the-fly.
--
dakkar - Mobilis in mobile
Most of my code is tested...
In reply to Re: Alternative ways to fully qualify subroutine names
by dakkar
in thread Alternative ways to fully qualify subroutine names
by bobf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |