Subject: | False positives. |
Script:
use strict;
use warnings;
use Package::Constants;
sub random (){ rand(10) }
say random;
say random;
say random;
say "Found $_" for Package::Constants->list(__PACKAGE__)
Sample output:
2.70781966698454
7.57814169951843
2.76819339991686
Found random
But the sub it found is not a constant according to any sensible definition of the word "constant".
B.pm is able to detect if a sub is a constant, for a *somewhat* better definition of the word "constant".