Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Monk Specs.?

by particle (Vicar)
on Jan 16, 2002 at 19:43 UTC ( [id://139223]=note: print w/replies, xml ) Need Help??


in reply to Re: Monk Specs.?
in thread Monk Specs.?

um... your points are valid, but this code is incorrect. *ducks*

while ( <LOG> ) { if ( /$date/ ) { print <LOG>; } }
firstly, you're reading from and printing to the same filehandle, probably a typo. it should print LOGFILE;. secondly, it's only printing lines that match the date, instead of printing all lines from the matched date until the end of the file.

~Particle

Replies are listed 'Best First'.
Re: Re: Re: Monk Specs.?
by talexb (Chancellor) on Jan 16, 2002 at 20:41 UTC
    Hmm .. don't think my code is wrong. The if statement watches for the correct date, and when that date's found, the entire rest of the file is output. My original reply had output going to STDOUT, but I later fixed that so it went to LOG_FILE, as in the original post. The input file handle is LOG.

    --t. alex

    "Of course, you realize that this means war." -- Bugs Bunny.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://139223]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-19 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found