Perl Script include
Hello
I have the code below that repeats in every Perl script(totally 22 script). I know that in C/C++ I can include the file. How can I do that in Perl? In other words, I want to make
function or include file and than call in each scipt
# 2 Send it to the socket
use IO::Socket;
$sock = IO::Socket::INET->new( PeerAddr => 'localhost',
PeerPort => '9399',
Proto => 'tcp'
);
die "Could not create socket: $! \n" unless $sock;
$sock->send($request);
# 3. Get feedback from socket and assign it to $feedback
$sock->recv($feedback,5000);
close ($sock);
# 4. Parse XML information
use XML::Simple;
my $xs1 = XML::Simple->new();
my $info = $xs1->XMLin($feedback);
Thanks
|