CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [achen] is this greedy?: Edit Log



savo
User

Sep 30, 2009, 8:27 AM


Views: 2242
Re: [achen] is this greedy?

you need /(regex)?/ to make it none greedy but because its a while loop it will still match twice so you need a count to stop the second here is what i have now its nearly working.


Code
open (LOG, "<test.log") or die "can't open log file: $!\n"; 
my $c = 1;
while (<LOG>) {
chomp;
{
if ($c == 1) {
if (/(ActiveConnectionsHighCount?)/){
say; ++$c}
}
}}



(This post was edited by savo on Sep 30, 2009, 8:30 AM)


Edit Log:
Post edited by savo (User) on Sep 30, 2009, 8:30 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives