in reply to Why does this happen?
A slow but possible and fun solution: Quantum::Superpositions. Tested; compiles, runs, and works correctly (I think). Needs Class::Multimethods.
:-)#!/usr/bin/perl use Quantum::Superpositions; print "What is your insult? "; chomp (my $input = <>); my @matching = qw/disk duck deck/; die if ($input eq any(@matching)); # could also use @matching[0..2]
|
---|
In Section
Seekers of Perl Wisdom