DEV Community

Discussion on: Yet Another Perl Switch Statement

Collapse
 
iamalnewkirk profile image
Al Newkirk
package main;

use Venus::Match;

my $match = Venus::Match->new(5);

$match->when(sub{$_ < 5})->then(sub{"< 5"});
$match->when(sub{$_ > 5})->then(sub{"> 5"});

$match->none(sub{"?"});

my $result = $match->result;

# "?"
Enter fullscreen mode Exit fullscreen mode

github.com/cpanery/venus/blob/mast...

Collapse
 
matthewpersico profile image
Matthew O. Persico

Oh, I'll bite (resisting the pun): Why "Venus"?