hdb's point was your code boils down to 'patch-5.1.1.21510' =~ /patch-5.1.1.21510.gpg/;, which is backwards from what you need. The behavior you seek would look more like
Though, as implemented, you'd have problems because of whitespace. For this case, you'd probably be better off using index.my @array = split('\n',$output); if ( grep { 'patch-5.1.1.21510.gpg' =~ /\Q$_\E/ } @array ) { print "Match found\n"; }
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re^3: Multiline match
by kennethk
in thread Multiline match
by arunbhargav
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |