good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: IO::Tee and write / formatby beadon (Initiate) |
on Oct 17, 2008 at 17:28 UTC ( [id://717822]=note: print w/replies, xml ) | Need Help?? |
wow, I see it now. Thanks for that huge tip.
There seems to be some problem when setting it just for the $tee though, write() seems to expect $~ and $^ to be filled in too , otherwise it keeps trying to use the name of the filehandle IO::<something> which obviously won't work. After setting $^ and $~ properly before write() then write began spitting out duplicate lines each time it was called. With each successive call to write, write() would output the previous line and the current line. to solve this I cleared the accumulator ( $^A = '' ) after writing each line. That solved the problem.
In Section
Seekers of Perl Wisdom
|
|