Subject: | How can it be used with eval and/or require? |
This works as documented:
my @a = (1,2);
use Const::Fast;
const(@a);
The following two variations do not work as I would expect:
perl -e '
my @a = (1,2);
require Const::Fast;
Const::Fast::const(@a);
'
Usage: Internals::SvREADONLY(SCALAR[, ON]) at ...
perl -e '
my @a = (1,2);
eval "use Const::Fast";
const(@a);
'
Usage: Internals::SvREADONLY(SCALAR[, ON]) at ...
What gives? If this is expected, could you document how to use
Const::Fast with eval/require? I was trying to make it optional in one
of my programs and I couldn't make sense from the examples above.
Thanks,