in reply to Re: Re: Detecting constant arguments passed to subroutines
in thread Detecting constant arguments passed to subroutines

I just noticed the REFCNT the Devel::Peek::Dump(undef) printed
That can't be right, can it?
  • Comment on Re: Re: Re: Detecting constant arguments passed to subroutines

Replies are listed 'Best First'.
Re: Re: Re: Re: Detecting constant arguments passed to subroutines
by japhy (Canon) on May 17, 2001 at 01:44 UTC
    Perhaps it's that high so that it never "dies"? And the reason it doesn't say undef is constant (from my function) is because undef = $foo is illegal, but (undef) = $foo isn't. Fix:
    sub is_const { defined($_[0]) and !eval { ($_[0]) = $_[0]; 1 } }


    japhy -- Perl and Regex Hacker
Re: Re: Re: Re: Detecting constant arguments passed to subroutines
by chipmunk (Parson) on May 17, 2001 at 01:43 UTC
    undef is a very popular value! :)