Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
No such thing as a small change
 
PerlMonks  

Re: •Re: Is it possible to distinguish contstants from normal subs?

by ariels (Curate)
on May 19, 2002 at 06:39 UTC ( #167619=note: print w/ replies, xml ) Need Help??


in reply to •Re: Is it possible to distinguish contstants from normal subs?
in thread Is it possible to distinguish contstants from normal subs?

The way I read the perldoc, a constant is "a subroutine with an empty prototype" which never changes its return value! There is a clear difference: compare

sub foo () { 17 }
with
sub bar () { rand(10) }
Deparsing use of both functions in code shows a clear difference in the way Perl treats each one.


Comment on Re: •Re: Is it possible to distinguish contstants from normal subs?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-04-19 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (477 votes), past polls