Type of arg 1 to Readonly::Readonly must be one of [$@%] (not scalar assignment) at monk_ro.pl line 8, near "'bar';" Execution of monk_ro.pl aborted due to compilation errors. #### perl -Mstrict -we 'sub f(\$){}; f(my $x)' #### perl -Mstrict -we 'sub f(\$){}; f(my $x = 3)' #### Type of arg 1 to main::f must be scalar (not scalar assignment) at -e line 1, near "3) #### *** lib/Readonly-orig.pm 2016-01-27 11:21:02.875021600 -0500 --- lib/Readonly.pm 2016-01-27 19:12:43.312714100 -0500 *************** *** 298,303 **** --- 298,305 ---- my $badtype = _is_badtype (ref tied ${$_[0]}); croak "$REASSIGN $badtype" if $badtype; croak "Readonly scalar must have only one value" if @_ > 2; + croak 'You meant $sca => $val not $sca = $val' + if @_ == 1 && defined ${$_[0]}; my $tieobj = eval {tie ${$_[0]}, 'Readonly::Scalar', $_[1]}; # Tie may have failed because user tried to tie a constant, or we screwed up somehow.