Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Multiple Sourse files

Reply
Thread Tools

Multiple Sourse files

 
 
makobutm@gmail.com
Guest
Posts: n/a
 
      09-20-2005
Hello all,
Is it possible to have multiple sourse files in a perl program like
in PHP? PHP uses "include(script.php)" to run the code in script.php.
But the best way would be like in C where one can run or use a function
in a different sourse file as long as its listed in the header file.
Does perl have a feature like that?

 
Reply With Quote
 
 
 
 
Random Task
Guest
Posts: n/a
 
      09-20-2005
Do a google for perl modules ... normally on your system if you have
perl installed ... the are normally named <filename>.pm.

The first line in a perl module is normally "1;" (after the magic cookie
that is).

You can import/use them like any other perlmodule

Hope this helps,
Jim
www.gomba.ca

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hello all,
> Is it possible to have multiple sourse files in a perl program like
> in PHP? PHP uses "include(script.php)" to run the code in script.php.
> But the best way would be like in C where one can run or use a function
> in a different sourse file as long as its listed in the header file.
> Does perl have a feature like that?
>

 
Reply With Quote
 
 
 
 
Anno Siegel
Guest
Posts: n/a
 
      09-20-2005
[top posting rectified]

Random Task <(E-Mail Removed)> wrote in comp.lang.perl.misc:
> (E-Mail Removed) wrote:


> > Hello all,
> > Is it possible to have multiple sourse files in a perl program like
> > in PHP? PHP uses "include(script.php)" to run the code in script.php.
> > But the best way would be like in C where one can run or use a function
> > in a different sourse file as long as its listed in the header file.
> > Does perl have a feature like that?


> Do a google for perl modules ... normally on your system if you have


What good is google going to do? There are far more specific resources
to point to.

> perl installed ... the are normally named <filename>.pm.


That much is true.

> The first line in a perl module is normally "1;"


No, the *last* line of a perl module is usually "1;", but that's a rather
irrelevant technicality. It's certainly not among the first things someone
ought to learn about Perl modules.

> (after the magic cookie that is).


What on earth are you talking about? There are no magic cookies in
Perl modules.

> You can import/use them like any other perlmodule


We were talking about any Perl module. Recursive definitions sometimes
work, recursive explanations never do.

> Hope this helps,


I'm afraid it doesn't.

To the OP: Start with reading perlmod (type "perldoc perlmod" to see it).

Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      09-20-2005
(E-Mail Removed) wrote:
> Is it possible to have multiple sourse files in a perl program like
> in PHP? PHP uses "include(script.php)" to run the code in script.php.
> But the best way would be like in C where one can run or use a
> function in a different sourse file as long as its listed in the
> header file. Does perl have a feature like that?


Many different ways, depending upon what you are trying to achive:
perldoc -f do
perldoc -f require
perldoc -f use
perldoc perlmod
I am sure I missed a few.

jue


 
Reply With Quote
 
Anno Siegel
Guest
Posts: n/a
 
      09-27-2005
Jürgen Exner <(E-Mail Removed)> wrote in comp.lang.perl.misc:
> (E-Mail Removed) wrote:
> > Is it possible to have multiple sourse files in a perl program like
> > in PHP? PHP uses "include(script.php)" to run the code in script.php.
> > But the best way would be like in C where one can run or use a
> > function in a different sourse file as long as its listed in the
> > header file. Does perl have a feature like that?

>
> Many different ways, depending upon what you are trying to achive:
> perldoc -f do
> perldoc -f require
> perldoc -f use
> perldoc perlmod
> I am sure I missed a few.


-P in perlrun.

Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sourse & installation krupali.kb@gmail.com Java 4 02-18-2008 07:08 PM
Any help sourse for draw UML in poseidon? shimajavar General Computer Support 0 10-26-2006 03:33 PM
Sourse Routing Bhaskar Cisco 2 01-31-2006 02:28 PM
Text files read multiple files into single file, and then recreate the multiple files googlinggoogler@hotmail.com Python 4 02-13-2005 05:44 PM
Beginner Help: Joining Multiple classes in multiple files? JHenstay C++ 3 01-11-2004 02:28 PM



Advertisments