{ package Naughty; use base 'Exporter'; our @EXPORT = 'some_func'; sub some_func { 'naughty function. no biscuit' } } { package Unsuspecting; Naughty->import; sub new { bless {}, shift } sub _private { 'Unsuspecting _private' } } if ( Unsuspecting->can('some_func') ) { die "a horrible death"; } elsif ( Unsuspecting->can('_private') ) { die "Don't rely on private methods!"; } else { print "home free"; }