Created
June 23, 2013 05:28
-
-
Save yagince/5843899 to your computer and use it in GitHub Desktop.
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
| use 5.012; | |
| sub my_push { | |
| my $list_ref = shift; | |
| my $item = shift; | |
| push @$list_ref, $item; | |
| } | |
| my @orig = (1,2,3); | |
| my_push \@orig, 10; | |
| # my_push \(1,2,3), 10; #これはできない Not an ARRAY reference たしかに、配列ではなくて、リスト、、だけど。 | |
| say "@orig"; | |
Author
Author
my_push [1,2,3], 10;これで良かった。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
無名配列コンストラクタという物を知った。
なるほど、やっとわかってきた。
リストと配列の違い。