in reply to Re^3: Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ^]/ (updated)
in thread Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ^]/
darn, constants are not interpolated in strings or regexes.
As I understand it, even with use constant, a constant in Perl is an in line sub. IE:
use constant PI => 4 * atan2(1, 1);
is the short hand for
sub PI { 4 * atan2(1, 1); }
Which, after compile time constant expression evaluation, simplifies to:
sub PI { 3.1415926536; # to the precision available on the machine running +the program }
which the compiler can then in line where it would otherwise put a sub call.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE ^]/
by LanX (Saint) on Apr 29, 2014 at 17:01 UTC | |
by AnomalousMonk (Archbishop) on Apr 30, 2014 at 11:07 UTC |