Skip to content

Instantly share code, notes, and snippets.

@krrrr38
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krrrr38/10515475 to your computer and use it in GitHub Desktop.
Save krrrr38/10515475 to your computer and use it in GitHub Desktop.
サブルーチンプロトタイプに関数与えた際に勝手に付くuseとか
#!/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;
}
#!/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;
}
#!/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