Perl での部分参照の作り方。
Created
November 21, 2011 04:01
-
-
Save dora-gt/1381577 to your computer and use it in GitHub Desktop.
How to make partial reference in Perl.
This file contains hidden or 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/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