Click here to get back home

Is there an include for perl?

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Is there an include for perl? Bill H 06-16-2008
Posted by Bill H on June 16, 2008, 12:26 pm
Please log in for more thread options
I am looking for an include for perl. I know about require, use etc
and use them, but I have a program that is getting large and would
like to put some of the code into their own files and just use a
include "filename" where the code I pulled belongs and have nothing
else done to that included code other than it being inserted when the
program is run. As an example:


main program:

line 1
line 2
include "other program"
line 3
line 4

other program
line 2a
line 2b
line 2c

when perl runs main program it sees it as

line 1
line 2
line 2a
line 2b
line 2c
line 3
line 4

I know you can do this with require but I have issues with variables
being set in one require not being available in another

Bill H

Posted by A. Sinan Unur on June 16, 2008, 1:12 pm
Please log in for more thread options
3ba53955cbfa@y21g2000hsf.googlegroups.com:

> I am looking for an include for perl. I know about require, use etc
> and use them, but I have a program that is getting large and would
> like to put some of the code into their own files and just use a
> include "filename" where the code I pulled belongs and have nothing
> else done to that included code other than it being inserted when the
> program is run. As an example:
>

http://search.cpan.org/~autrijus/Filter-Macro-0.11/lib/Filter/Macro.pm

--
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/

Posted by Jürgen Exner on June 16, 2008, 1:19 pm
Please log in for more thread options
>I am looking for an include for perl. I know about require, use etc
>and use them, but I have a program that is getting large and would
>like to put some of the code into their own files and just use a
>include "filename" where the code I pulled belongs and have nothing
>else done to that included code other than it being inserted when the
>program is run.

Are you looking for do()?

jue

Posted by Bill H on June 16, 2008, 2:07 pm
Please log in for more thread options
> >I am looking for an include for perl. I know about require, use etc
> >and use them, but I have a program that is getting large and would
> >like to put some of the code into their own files and just use a
> >include "filename" where the code I pulled belongs and have nothing
> >else done to that included code other than it being inserted when the
> >program is run.
>
> Are you looking for do()?
>
> jue

Hi Jurgen. I looked at do() and it didn't seem to fit what I want.

Bill H

Posted by Jürgen Exner on June 16, 2008, 2:12 pm
Please log in for more thread options
>> >I am looking for an include for perl. I know about require, use etc
>> >and use them, but I have a program that is getting large and would
>> >like to put some of the code into their own files and just use a
>> >include "filename" where the code I pulled belongs and have nothing
>> >else done to that included code other than it being inserted when the
>> >program is run.
>>
>> Are you looking for do()?
>
>Hi Jurgen. I looked at do() and it didn't seem to fit what I want.

Well, I suppose you can always run your Perl program through cpp first
and feed the result to perl.

jue

Similar ThreadsPosted
include files with Perl July 13, 2004, 2:41 pm
How to express "include" in perl September 9, 2005, 2:18 pm
cpp-style include for perl? January 22, 2006, 2:35 pm
Perl analog to #include "..." ? July 12, 2006, 11:21 am
include external perl program March 8, 2005, 10:06 am
Re: include external perl program March 10, 2005, 9:40 am
Re: include external perl program March 10, 2005, 9:40 am
perl module include error June 28, 2006, 12:42 pm
Newbie...Not able to include a file in perl script February 19, 2007, 10:43 pm
How to structure a perl program to include and exclude files? July 18, 2004, 8:25 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap