Skip to content

Instantly share code, notes, and snippets.

@dora-gt
Created November 21, 2011 04:01
Show Gist options
  • Save dora-gt/1381577 to your computer and use it in GitHub Desktop.
Save dora-gt/1381577 to your computer and use it in GitHub Desktop.
How to make partial reference in Perl.

Perl での部分参照の作り方。

#!/usr/bin/perl
use strict;
my $whole_string = "aiueo";
my $partial_reference = \substr ($whole_string,2,2);
print "The value of partial reference is: " . $$partial_reference . "\n";
$$partial_reference = "12";
print "The whole value has been changed to: " . $whole_string . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment