Skip to content

Instantly share code, notes, and snippets.

@gfx
Created November 7, 2010 09:27
Show Gist options
  • Save gfx/666033 to your computer and use it in GitHub Desktop.
Save gfx/666033 to your computer and use it in GitHub Desktop.
#!perl -w
use strict;
use Smart::Args;
use MooseX::Types::Structured qw(:all);
use MooseX::Types::Moose qw(:all);
use Data::Dumper;
sub foo {
# Tuple()にはカッコが必要(さもないと後続の引数 my $baz を飲み込んでしまうため)
args my $bar => Tuple([ Str, Str, Str ]), my $baz;
print Dumper([$bar, $baz]);
}
foo bar => [1, 2, 3], baz => 42; # OK
foo bar => [ 10 ], baz => 42; # boom!
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment