PM,>And Uri has a very good point about needing to include some way to verify
that the regex actually matched and returned values.
I always - put the regexp in a condition - use the optional "m" - use m{} if
the regexp has a "/" in it. - use \A for ^ - use \Z for $ - use (?:) when
group not needed in $N
- and assign $N to well named scoped variables before anything else.
if ($string =~ m/\A(.)(?:.)(.)\Z/) { my $char1 = $1; my $char3 = $2;
dosomething($char1, $char3);} else {
die("handle string not what expected");}
Michael R. Davis
_______________________________________________
Houston mailing list
[email protected]
https://mail.pm.org/mailman/listinfo/houston
Website: http://houston.pm.org/