This constant won't be available from other files, especially it won't be inherited, but the getter method would.No! It works fine (when we talk about method)! Seems it's available from any other place, and can be inherited. Example:
package XX; use constant timeout => 42; 1; package YY; use parent -norequire, 'XX'; 1; package main; use strict; use warnings; my $y = bless +{}, "YY"; print $y->timeout; # fine! 1;
So shall it be private or not?Not necessary.
In reply to Re^2: Using constants as methods
by vsespb
in thread Using constants as methods
by vsespb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |