Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: [IO::Pty] How to read from and write to slave?

by choroba (Abbot)
on Jul 04, 2014 at 06:40 UTC ( #1092243=note: print w/ replies, xml ) Need Help??


in reply to [IO::Pty] How to read from and write to slave?

I don't know much about pseudo terminals. Just for curiosity, I tried your code on a Linux machine. I had to modify == to eq to prevent lots of warnings. I also get a different output if I change chomp to s/\s+$// (there was "\r" present). To reduce the output, I also print only if length $line. 2, 4, and 6 never get to the output, but sometimes, I get something like:

TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 3 TIME: Fri Jul 4 08:38:34 2014 OUTPUT: 1

Something weird's going on.

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: [IO::Pty] How to read from and write to slave?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-10-02 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (50 votes), past polls