Ea has asked for the wisdom of the Perl Monks concerning the following question:
I was testing that constants were really constants as suggested in a review by Neil Bowers and the following doesn't compile.
and the execution aborts with Can't modify constant item in scalar assignmentuse constant PI => 3.14; eval { PI = 3; }; warn "You can't round down PI to 3" if $@;
I've tried it on perls v5.16.3 and v5.18.4 on linux. Any suggestions on what is going on here? Have I missed something?
http://act.yapc.eu/lpw2015/ It's that time of year again!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Eval not trapping fatal error
by Corion (Patriarch) on Dec 07, 2015 at 12:07 UTC | |
by Ea (Chaplain) on Dec 07, 2015 at 12:26 UTC | |
by Corion (Patriarch) on Dec 07, 2015 at 12:34 UTC | |
Re: SOLVED: Eval not trapping fatal error
by kcott (Archbishop) on Dec 07, 2015 at 20:32 UTC |