Monday, April 21, 2008

Module Monday: Quantum::Superpositions

A new weekly feature. I'm going to dig out some of the hidden gems of CPAN. One of the best places to look is Damian Conway's list of modules and this is one fun and interesting one.

Here's a selection of what Quantum::Superpositions can do:

$wanted = any("Mr","Ms").any(@names);
if ($name eq $wanted) { print "Reward!"; }

$okay = all(\&check1,\&check2);
die unless $okay->();

my $large =
all( BigNum->new($centillion),
BigNum->new($googol),
BigNum->new($SkewesNum)
);
@huge = grep {$_ > $large} @nums;

No comments: