Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Queries on open3

by thiagu_mvt (Sexton)
on Apr 23, 2009 at 14:03 UTC ( [id://759533]=note: print w/replies, xml ) Need Help??


in reply to Re: Queries on open3
in thread Queries on open3

When I change my function as below and send "sleep 50" as a command, can_write is returning input file handle as one of the value. so it means it can be written ?. I expected it should not return input file handle since we cannot write into 'sleep' command.

Any Explanation or fix??

sub canSendInput { my $self = shift; my $pid = waitpid($self->{pid}, WNOHANG) my @ready = $self->{'selector'}->can_write(1);# Dumper(\@ready); }

Thanks,
Thiagu

Replies are listed 'Best First'.
Re^3: Queries on open3
by ikegami (Patriarch) on Apr 23, 2009 at 14:33 UTC

    I expected it should not return input file handle since we cannot write into 'sleep' command.

    You don't write "into a sleep command". You write into a pipe. As long as the pipe isn't full, it'll report that it can accept data.

    Perhaps you want Expect?

      I have used syswrite and checking the number of bytes written. also using SIGPIPE.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-25 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found