Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Re: Detecting constant arguments passed to subroutines

by dcd (Scribe)
on May 17, 2001 at 01:39 UTC ( [id://81096]=note: print w/replies, xml ) Need Help??


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! :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://81096]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found