Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^4: Communication between Windows and Linux via Perl

by salva (Abbot)
on Apr 12, 2013 at 13:14 UTC ( #1028370=note: print w/replies, xml ) Need Help??

in reply to Re^3: Communication between Windows and Linux via Perl
in thread Communication between Windows and Linux via Perl

Well, the truth it is a little tricky:

First, you should loop until the eof method from Net::SSH2::Channel returns true.

In order to not have a busy loop, you can use sock (that returns the socket used for the SSH connection) and block_directions (which tells one if Net::SSH2 needs to write or read from that socket) combined with select to wait for some activity on the SSH socket.

Or you can just use Net::SSH::Any that will do all of that for you (or you can also look at its source code for inspiration).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028370]
[ovedpo15]: my code checks the value after that comma, if it isn't valid it will remove it. so I would like to remove the substring after that comma meaning getting the string before comma.
[hippo]: Are you sure that Text::CSV_XS isn't already installed at your work? It's such a useful module that it might well be there.
[marto]: pointing out the advantages of cpan modules is well worth in, as both developer and $client/$company benefit greatly
[Tux]: $src =~ m{^(.*),(.*)$/ and $2 !~ $valid and $src = $1;
[Tux]: s,/,},

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2018-05-27 10:51 GMT
Find Nodes?
    Voting Booth?