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

Re: nohup & PERL.

by Dragonfly (Priest)
on Apr 17, 2002 at 01:05 UTC ( #159691=note: print w/ replies, xml ) Need Help??

in reply to nohup & PERL.

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 = ''; 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.

Comment on Re: nohup & PERL.
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2015-10-10 17:04 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (257 votes), past polls