You don't show the part of the code that does the printing, so it's difficult to say how you should modify it in order to avoid your unwanted output. If you can clearly delineate what makes a line a "BEA warning" or not, then you could skip them perhaps w/ Loop Control:

This of course assumes that the warnings in question are being emitted on STDOUT and not STDERR.

If this solution is not what you are looking for, provide us with the entire STDOUT stream from your system call and the desired output from your program, as well as the entire block of read-and-output code that is presently not working for you.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Are you using IPC::Open3 or are you using backticks? For the latter, you would presumably need to capture the output filter it, probably by splitting on new-lines and feeding it through the loop above.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Let me tell u bigger picture I am calling this perl from java which inturn call somejava file for validation.My server side java expects the output stream as i mentioned above .If i am printing line by line my java is getting only 1st line