in reply to Pure perl lexical sub import

If you don't want to take code from Exporter, you can do it like this:

BEGIN { *looks_like_number = \&Scalar::Util::looks_like_number; }
#!perl use 5.020; use Scalar::Util (); BEGIN { *looks_like_number = \&Scalar::Util::looks_like_number; } say looks_like_number(42);

Replies are listed 'Best First'.
Re^2: Pure perl lexical sub import
by Arunbear (Prior) on Dec 21, 2024 at 14:58 UTC
    I think this will still suffer from littering his method namespace.