Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 contemplating the Monastery: (9)
As of 2015-07-04 11:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls