Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: tailing the file and look for string

by sundialsvc4 (Monsignor)
on Aug 07, 2014 at 02:40 UTC ( #1096539=note: print w/ replies, xml ) Need Help??


in reply to Re^2: tailing the file and look for string
in thread tailing the file and look for string

To echo GotToBTru’s sentiment ... and, to explain myself ... I made this “sideways” suggestion to offer a very different approach to the problem:   one that does not involve using any sort of tail-command.   I fully recognize that this might not be something that you are presently interested in, and I am also not insisting that you should.   It might well not be business-sensible in this case for you to “start over.”

Basically:   one way to tackle this requirement is to do it the way that you are doing.   This is very-much a “bash-script strategy” in the sense that the bash-script engine is not designed to be a full-featured programming tool, therefore if you want to do these things, you must avail yourself of commands such as tail and go from there.

But, another way to do it is to write a program that fully embraces the fact that Perl is a full-featured language with complete integrated ability to seek and read random-access files.   This is an approach that has nothing-at-all to do with the one that you are now pursuing.   “In Perl, it is available to you.   That being said, it might or might not be the right thing to do.”

And that is what prompted my response.   Yes, partly written to the “Peanut Gallery” that will at some future aeon encounter this thread.   (Perhaps, by then, as an Archaeological Curiosity.)   “Another Way To Do It.™”


Comment on Re^3: tailing the file and look for string

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2014-09-17 12:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (73 votes), past polls