use strict; use warnings; use 5.012; sub do_stuff(\$) { my $sref = shift; say $$sref; } #### my $str = 'hello'; do_stuff($str); #legal: no slash in position 1 of arg list --output:-- hello #### my $str = 'hello'; do_stuff(\$str); #illegal: slash in position 1 of arg list --output:-- Type of arg 1 to main::do_stuff must be scalar (not single ref constructor) #### my $str = \'hello'; do_stuff($str); #legal: no slash in position 1 of arg list --output:-- SCALAR(0x100839858)