in reply to Dualvars besides $!

I think you are misinterpreting the results of your test. (No, I was misunderstanding what point was being made. ;)

Scalar::Util::isdual returns a true value if the variable being tested is a dualvar. Your test indicates that isdual is returning 1 when tested against $!, which is a true value, indicating that $! is a dualvar.

Update: A list of "dualvar" special variables, as I find them.

Also, since $_ implicitly topicalizes a foreach loop, and since it's an alias to an iteration's topic, it can be made to appear to be a dualvar:

for ( $! ) { print Scalar::Util::isdual($_), "\n"; }

...outputs '1', because in this case $_ is an alias to a dualvar. So we can add to the list:


Dave

Replies are listed 'Best First'.
Re^2: Dualvars besides $!
by szabgab (Priest) on Jan 27, 2014 at 18:50 UTC
    That's my point. dualvar indicates that $! is indeed a dualvar but the documentation of Scalar::Util say $! is not a dualvar. Or did I misunderstand what the documentation claims?

      Oh, I see what you're saying. It's probably a bug in the documentation for isdual, though relying on how a feature is implemented internally always carries risks.


      Dave