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
withsub foo () { 17 }
Deparsing use of both functions in code shows a clear difference in the way Perl treats each one.sub bar () { rand(10) }
|
---|
In Section
Seekers of Perl Wisdom