in reply to Pure perl lexical sub import

> but this gives me "Illegal declaration of subroutine looks_like_number".

For completeness, I ran into the same problem, but feature refaliasing is your friend.

According to the docs it was introduced with v5.22

use experimental 'lexical_subs','refaliasing'; my sub looks_like_number; \&looks_like_number = \&Scalar::Util::looks_like_number;

see also my proof of concept in Re^3: Pure perl lexical sub import (POC)

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery