in reply to perl regular expressions and empty strings unexpected results
(print "" =~ /.*/) and "" =~ /bar/
The first regex match succeeds (thus the 1), and the result of the second one is discarded. Use && instead of and to get the result you want.
See also: perlop.
|
|---|