Created
July 30, 2014 13:30
-
-
Save tomcha/8f4df472a82b6679295f to your computer and use it in GitHub Desktop.
Perlのサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
#値渡し | |
my @array_a = (0, 1, 2); | |
my @array_b = @array_a; | |
$array_b[1] = 'a'; | |
print Dumper(\@array_a); | |
#参照渡し | |
my @array_c = (0, 1, 2); | |
my $array_d = \@array_c; | |
$$array_d[1] = 'a'; | |
print Dumper(\@array_c); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment