http://www.perlmonks.org?node_id=167619


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.