C:\chas_sandbox> perl -Mdiagnostics -le "sub doit{$ref=$_;\\$ref = 'nope'};$str='cwh';print $str;doit($str);print$str" Can't modify single ref constructor in scalar assignment at -e line 1, near "'nope'}" Execution of -e aborted due to compilation errors (#1) (F) You aren't allowed to assign to the item indicated, or otherwise try to change it, such as with an auto-increment. Uncaught exception from user code: Can't modify single ref constructor in scalar assignment at -e line 1, near "'nope'}" Execution of -e aborted due to compilation errors. at -e line 1 C:\chas_sandbox>