LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2002, 01:45 PM   #1
mikeshn
Member
 
Registered: Feb 2002
Posts: 586

Rep: Reputation: 30
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
 
Old 08-20-2002, 10:55 AM   #2
fork
LQ Newbie
 
Registered: Aug 2002
Posts: 1

Rep: Reputation: 0
require "mylib.pl";
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
include a file in perl script Ateo Programming 1 04-22-2005 10:53 PM
php include()/require() script question atom Programming 11 08-19-2004 02:12 AM
Converting a Windows Perl script to a Linux Perl script. rubbercash Programming 2 07-19-2004 11:22 AM
need perl fuction like c #include statement for header file mrtwice Programming 5 06-19-2003 03:42 PM
Including methods from a perl script into another perl script gene_gEnie Programming 3 01-31-2002 06:03 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration