LinuxQuestions.org
Register a domain and help support LQ
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
 
LinkBack Search this Thread
Old 08-09-2002, 12:45 PM   #1
mikeshn
Member
 
Registered: Feb 2002
Distribution: Fedora Core 2
Posts: 587

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, 09: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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 06:39 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration