in reply to Re: Match typoin thread Match typo
while(<DATA>){ $ =~ m/publish|date/; } __DATA__ The book was published on the date "20-08-2009". [download]
If you want an exact match, that's easy:
while (<DATA>){ print "matched\n" if /publish/ and /date/; } [download]
But note that this would also match "the date was published on"...
If the order in which the words must occur is relevant, you could do
while (<DATA>){ print "matched\n" if /publish.*date/; } [download]