LanX has asked for the wisdom of the Perl Monks concerning the following question:
Bug or feature???DB<174> use Scalar::Util qw(readonly) DB<175> sub tst { print readonly($_[0]) ? "r" : "rw" } DB<176> tst 0 r DB<177> tst undef rw DB<179> print readonly(undef) ? "r" : "rw" r
Cheers Rolf
DB<181> sub tst { $_[0] = 42 } DB<182> tst 5 Modification of a read-only value attempted at (eval 119)[/usr/share/p +erl/5.14/perl5db.pl:640] line 2. DB<183> tst undef => 42 # really?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why is "undef" after passing not readonly anymore?
by Tux (Canon) on Sep 05, 2012 at 18:25 UTC | |
by LanX (Saint) on Sep 05, 2012 at 18:29 UTC | |
by Anonymous Monk on Sep 05, 2012 at 19:50 UTC | |
|
Re: Why is "undef" after passing not readonly anymore?
by philiprbrenan (Monk) on Sep 06, 2012 at 00:34 UTC | |
by LanX (Saint) on Sep 07, 2012 at 08:37 UTC |