Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
You might want to look into socket programming in Perl; it's not really that terribly difficult to get started, and there are some good examples around the Monastary. Here is a short example of networking with IO::Socket.

use strict; use IO::Socket; my $host = 'pdp11.mydomain.net'; my $port = 6740; my $socket = new IO::Socket::INET(PeerAddr => $host, PeerPort => $port, Proto => 'tcp'); die "cannot open socket" unless ($socket); #send a custom command to the PDP-11 server my $cmd = "GIMME\n"; print $socket $cmd; # print the server's response to the gimme request while (<$socket>) { print; } close $socket;

The reason I suggest this type of approach is that using netcat is going to limit portability for your code, if you decide to try and run it on a platform that doesn't have netcat for instance.

Also, using spawned external child processes will likely lead to more issues such as the one you're having. It's probably a better idea to use the functionality that's already built in to Perl.


In reply to Re: nohup & PERL. by Dragonfly
in thread nohup & PERL. by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-25 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found