so /(need)/ would match the word need.
... and return the matched word 'need'; but yes.
However, what is the purpose of capturing the matched word when you already know what it is?
Ie. If your intent is to do:
my( $foundWord ) = $string =~ /(need)/;
That is equivalent to doing: my $foundWord = $string =~ /need/ ? 'need ' : undef;
The point being that capturing is expensive and the need to capture a known constant string is strongly indicative of flawed logic.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
In the absence of evidence, opinion is indistinguishable from prejudice.
|