Skip to content

Instantly share code, notes, and snippets.

@tomcha
Created July 30, 2014 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomcha/8f4df472a82b6679295f to your computer and use it in GitHub Desktop.
Save tomcha/8f4df472a82b6679295f to your computer and use it in GitHub Desktop.
Perlのサンプル
#!/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