Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I think I must not have done a good enough job explaining what my problem is, as most suggestions have been dealing with monitoring log files or how to send emails or how to still view the output while piping to perl. The problem I am having is a script is NOT writing to a log file, it is dumping its output to STDOUT. They want me to write a perl script that can either call their script or they will pipe their output to my perl script. There script never stops until it is killed, and the data pumps out pretty fast, about three lines per second. They want my script to watch the output as it comes out and send an email if it see's a certain event occur. I know how to send the email and all that, Its just when I created my array,
@array= <STDIN>;
the program would wait until it stopped recieving STDIN before it would process the array, so it wouldnt check the input as it was coming in. The above post seemed to help a bit. (doing a while loop on STDIN) cause it appears that it proccesses a chunk at a time, it looks to me like 50 lines or so at a time, but it still isn't line by line... I will continue to play with the above while loops to see if I can get something acceptable to them...
Like I said, it dumps about 3 lines per second, so if it does infact do chunks of 50 or so at a time as it is getting it, that may be fine, we can just blame the lag on email ;)

In reply to Re: Re: reading output from another script by Octavian
in thread reading output from another script by Octavian

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2022-01-27 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (70 votes). Check out past polls.

    Notices?