On Sat, 05 Apr 2008 12:25:15 +1100, ken Foskey wrote: > Is there any real advantage of > > use constant PART_NUMBER => 'P/N'; > over > my $PART_NUMBER = 'P/N'; > > Yes I know that it can be modified but conventions such as upper case > constants can almost remove that problem.
Or totally remove the problem with use Readonly; Readonly my $PI, 3.14159265358979; You've already discovered one of the disadvantages of subroutine constants. Another is what it takes to interpolate them in strings. Then there's the package scoping rather than the more natural lexical scoping. Readonly.pm didn't exist when constant.pm was invented, but now it does. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/