Last active
August 29, 2015 13:59
-
-
Save krrrr38/10515475 to your computer and use it in GitHub Desktop.
サブルーチンプロトタイプに関数与えた際に勝手に付くuseとか
This file contains 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/env perl | |
use strict; | |
use utf8; | |
use Data::Dumper::Concise; | |
sub hoge(&;$) { | |
my $a = shift; | |
warn Dumper($a); | |
return $a->(); | |
} | |
hoge sub { return 3 } ; | |
__END__ | |
perl hoge.pl | |
sub { | |
use strict; | |
return 3; | |
} |
This file contains 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/env perl | |
use warnings; | |
use strict; | |
use utf8; | |
use Data::Dumper::Concise; | |
sub hoge(&;$) { | |
my $a = shift; | |
warn Dumper($a); | |
return $a->(); | |
} | |
hoge sub { return 3 } ; | |
__END__ | |
perl hoge.pl | |
sub { | |
use warnings; | |
use strict; | |
return 3; | |
} |
This file contains 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/env perl | |
package Hoge; | |
use strict; | |
use utf8; | |
use Data::Dumper::Concise; | |
sub hoge(&;$) { | |
my $a = shift; | |
warn Dumper($a); | |
return $a->(); | |
} | |
hoge sub { return 3 } ; | |
__END__ | |
perl hoge.pl | |
sub { | |
package Hoge; | |
use scrict; | |
return 3; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment