How To Avoid a Perl script calling an Another Perl Script

Posted by rockyurock on Stack Overflow See other posts from Stack Overflow or by rockyurock
Published on 2010-04-04T09:26:59Z Indexed on 2010/04/04 9:33 UTC
Read the original article Hit count: 857

Filed under:


i am calling a perl script from a main script to capture the output of in @output.

is there anyway to avoid the use of these two files so i can use the output of in itself

here is my code....

my @output = readpipe("");

#! /usr/bin/perl -w
#use strict;
use Socket;

#initialize host and port

my $host = shift || $FTP_SERVER;

my $port = shift || $CLIENT_PORT;

my $proto = getprotobyname('tcp');

#get the port address
my $iaddr = inet_aton($host);
my $paddr = sockaddr_in($port, $iaddr);

#create the socket, connect to the port
socket(SOCKET, PF_INET, SOCK_STREAM, $proto)or die "socket: $!\n";
connect(SOCKET, $paddr) or die "connect: $!\n";

my $line;
while ($line = )
print "$line\n";
close SOCKET or die "close: $!";


© Stack Overflow or respective owner

Related posts about perl