fork download
  1. sub hoge_r {
  2. my $s = shift;
  3. substr($$s, 1, 1) = "1";
  4. }
  5.  
  6. sub hoge {
  7. my $s = shift;
  8. hoge_r(\$s);
  9. }
  10.  
  11. my $a = "abc";
  12. my $b = $a;
  13. hoge($a);
  14. print $a."\n";
  15.  
  16. hoge_r(\$a);
  17. print $a."\n";
  18. print $b."\n";
  19.  
Success #stdin #stdout 0s 4596KB
stdin
Standard input is empty
stdout
abc
a1c
abc