Acme::Given::Hash

You like given but it's too much typing
Download

Acme::Given::Hash Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ben Hengst
  • Publisher web site:
  • http://search.cpan.org/~notbenh/

Acme::Given::Hash Tags


Acme::Given::Hash Description

Acme::Given::Hash is a Perl module.SYNOPSIS use Acme::Given::Hash; my $result = $given ~~ gvn { $value1 => $scalar , $value2 => do { ... } , $value3 => sub{ ... } } || $default ; # is going to result in the same thing as: my $result; given($given) { when ($value1) { $result = $scalar } when ($value2) { $result = do{ ... }} when ($value3) { $result = sub{...}->() } default { $result = $default } }; # if you use an arrayref you can do more complex matching $result = $given ~~ gvn , => 'works too' , {a=>b,c=>d} => 'same here' , gvn { foo => 'bar' } => 'also works but "bar" will be seen as a true value rather then the thing to match' ];Product's homepage


Acme::Given::Hash Related Software