Perl Regex Sorcery
You have been warned. Delving into the dark arts of regex can drive one to the brink of madness.
use strict;
use warnings;
our @ISA = ('Curses', 'Regex');
sub curse {
my ($pattern, $string) = @_;
if ($string =~ /$pattern/ ) {
print "Oooh, found it! $" =~ /$pattern/";
return 1;
}
print "Nay, 'twas not found";
return 0;
}
Don't say we didn't warn you... Rules of Darkness for the unwary.
Want more? Try Advanced Dark Arts for seasoned sorcerers.
Need a break? Take a Mystic Mug to go.