Smart::Args ã¨ã¯ å®è¡æåãã§ã㯠/ ãã©ã¡ã¼ã¿ã¼ãã§ãã¯ãåºæ¥ã便å©ãªã¢ã¸ã¥ã¼ã«ã§ãã ç¾å¨ã Params::Validate ãããã¡ã¯ãã¹ã¿ã³ãã¼ãã£ã½ããã§ãããé度ãé ãã£ããããã®ã§æ£ç´å¾®å¦ã§ãã ã¾ããé度ã£ã¦ãããè²ã é¢åãæãã ãªã¼ã£ã¦æã£ã¦ãã人ãå¤ãã¨æãã¾ãã Smart::Args ã®ä½¿ãæ¹ use Smart::Args; sub foo { args my $p => 'Int', my $q => { isa => 'Int', optional => 1 }; say $q ? "$p, $q" : $p; } foo(p => 1); # 1 foo(p => 1, q => 2); # 1, 2 ããã¾ãç°¡åï¼ ä¾ãã°ã以ä¸ã®ããã«ãã㨠foo(p => 'str'); 以ä¸ã®ããã«æããã¾ãã Validation failed f
{{#tags}}- {{label}}
{{/tags}}