Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. opendir(my $h, '.') or die $!;
  2.  
  3. sub a {
  4. my ($ref) = @_;
  5. $$ref = 100;
  6. }
  7.  
  8. my $value;
  9. a($value);
  10. STDOUT->say($value); # => 100
  11.  
  12. a(my $value);
  13. STDOUT->say($value); # => nothing
  14.  
  15. sub a {
  16. $_[0] = 100;
  17. }
  18.  
  19. a(my $x);
  20. print "$xn"; # => 100
  21.  
  22. sub a {
  23. my $x = $_[0];
  24. $$x = 100;
  25. }
  26.  
  27. a(my $x);
  28. print "$xn"; # => 100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement