in reply to Questions about Grep
If you take a look at 'man grep' and 'perldoc -f grep', you'll note a few differences. E.g. - commandline grep searches files, while Perl's grep searches lists. Commandline grep takes options; Perl's grep takes an expression or a subroutine. Commandline grep is limited to matching regular expressions; Perl's grep will return the matching elements for any test that returns 'true' for those elements.
In short, the very basic premise of "global regular expression print" - matching and returning a specified item - is about the only thing that the two have in common, and you're much safer assuming that what you know about one does not apply to the other.
-- Human history becomes more and more a race between education and catastrophe. -- HG Wells
|
|---|