Skip to content

Instantly share code, notes, and snippets.

@hisaichi5518
Created September 19, 2011 13:23
Show Gist options
  • Save hisaichi5518/1226479 to your computer and use it in GitHub Desktop.
Save hisaichi5518/1226479 to your computer and use it in GitHub Desktop.
プロトタイプ宣言
sub hoge (&) {
my ($callback) = @_;
$callback->();
}
# subがない
hoge {
print "hisada\n";
};
sub hogehoge (&@) {
my ($callback, @list) = @_;
$callback->(@list);
}
# , がない
my @huga = qw(piyo chinko);
hogehoge {
for my $name (@_) {
print $name, "\n";
}
} @huga;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment