- or download this
use strict;
...
my $sref = shift;
say $$sref;
}
- or download this
my $str = 'hello';
do_stuff($str); #legal: no slash in position 1 of arg list
--output:--
hello
- or download this
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 constru
+ctor)
- or download this
my $str = \'hello';
do_stuff($str); #legal: no slash in position 1 of arg list
--output:--
SCALAR(0x100839858)