http://www.perlmonks.org?node_id=638737


in reply to Regx: match without regarding space and case

This works for me:

my $x="My name is VC"; my $y="myname"; my $r = do { local $" = ' *'; my @r = split //, $y; qr/@r/i }; if ($x =~ /($r)/) { printf "Matched from %d to %d: '%s'\n", $-[0], $+[0], $1; }

Prints:

Matched from 0 to 7: 'My name'

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!