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

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
  • Comment on Re: Re: Re: Re: Detecting constant arguments passed to subroutines
  • Download Code