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 #### DB<181> sub tst { $_[0] = 42 } DB<182> tst 5 Modification of a read-only value attempted at (eval 119)[/usr/share/perl/5.14/perl5db.pl:640] line 2. DB<183> tst undef => 42 # really?