The exact approach will depend upon the problem you;re trying to solve.
my $match = qr/Hello\s*World/; while (<DATA>) { print if /$match/; } __DATA__ Hello World Hello World Hello World .
Optionally, you could copy the string to match and remove the spaces prior to the match, but whether or not such a destructive behavior is desireable again depends upon your needs.
Cheers,
Ovid
New address of my CGI Course.
In reply to Re: disregard spaces while matching ?
by Ovid
in thread disregard spaces while matching ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |