arunbhargav has asked for the wisdom of the Perl Monks concerning the following question:
I was trying to match the string "patch-5.1.1.21510.gpg" to the above multiline string. I tried the pattern modifier for multiline match, but couldnt match it. All I had to do was use grep which I dont think is needed here.my $output = "update patch-5.1.1.21510";
What am I missing here?my @array = split('\n',$output); if ( grep { $_ =~ /$PatchPath/ } @array ) { print "Match found\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiline match
by LanX (Saint) on May 23, 2013 at 16:20 UTC | |
|
Re: Multiline match
by davido (Cardinal) on May 23, 2013 at 16:35 UTC | |
by arunbhargav (Novice) on May 23, 2013 at 16:40 UTC | |
by davido (Cardinal) on May 23, 2013 at 16:51 UTC | |
by arunbhargav (Novice) on May 23, 2013 at 18:38 UTC | |
|
Re: Multiline match
by hdb (Monsignor) on May 23, 2013 at 16:22 UTC | |
by arunbhargav (Novice) on May 23, 2013 at 16:27 UTC | |
by kennethk (Abbot) on May 23, 2013 at 16:33 UTC | |
by hdb (Monsignor) on May 23, 2013 at 16:39 UTC | |
by LanX (Saint) on May 23, 2013 at 16:32 UTC | |
by arunbhargav (Novice) on May 23, 2013 at 16:33 UTC | |
by LanX (Saint) on May 23, 2013 at 16:45 UTC | |
by hdb (Monsignor) on May 23, 2013 at 16:36 UTC |