{ # localizing $" is a good idea... local $"=""; if ($string =~ m#^[@$chars]$#) { print "OKie! $string is a subset of @$chars\n"; } else { print "Bad $string! Bad!\n"; } }
$" sets the string that perl puts between items in an array when the array is interpolated in a doublequoted string. BTW, regexen are treated like doublequoted strings. You can stick variables in there, backwhack for special characters like \n and much more. =)
--
$you = new YOU;
honk() if $you->love(perl)
In reply to Re: Some sexy regex
by extremely
in thread Some sexy regex
by Martin A
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |