Import other perl files

R

Robin Wilson

I have a perl file which I would like to divide up into 2 perl files so that
the content is seperate

I created 2 files and then moves some variables into the other file but I
cannot work out how to include the second file

I thought the syntax was:

USE FILE.PL

but that's not working

Please can someone tell me the correct syntax

Thanks
Robin
 
A

A. Sinan Unur

I have a perl file which I would like to divide up into 2 perl files
so that the content is seperate

I created 2 files and then moves some variables into the other file
but I cannot work out how to include the second file

I thought the syntax was:

USE FILE.PL

use not USE. Case matters.

perldoc use
but that's not working

Please can someone tell me the correct syntax

Reading the docs will tell you that.

You should also read:

perldoc perlmod

Sinan
 
J

Josef Moellers

Robin said:
I have a perl file which I would like to divide up into 2 perl files sothat
the content is seperate

I created 2 files and then moves some variables into the other file butI
cannot work out how to include the second file

I thought the syntax was:

USE FILE.PL

but that's not working

Do not use USE, use use ;-)
 
R

rrrrrr rrrrrrrr

Keith Keller <[email protected]> trolled:

[coward's words deleted]

Keith Keller hides his PGP in this group to curry favour with people
he wishes to impress. In alt.os.linux.slackware he advocates using
PGP because he wishes to curry favour with people in that group he
wishes to impress.

Keith Keller is a coward fit for killfiles.
 
G

Glenn Jackman

At 2006-02-27 05:06PM said:
I have a perl file which I would like to divide up into 2 perl files so that
the content is seperate

I created 2 files and then moves some variables into the other file but I
cannot work out how to include the second file

I thought the syntax was:

USE FILE.PL

but that's not working

Please can someone tell me the correct syntax

I think what you want is: require './file.pl';
'use' looks for a proper module with the proper file extension in
particular locations.

Make sure the last statement of file.pl returns a true value. e.g. "1;"
 
J

Josef Moellers

rrrrrr said:
Keith Keller <[email protected]> trolled:

[coward's words deleted]

Keith Keller hides his PGP in this group to curry favour with people
he wishes to impress. In alt.os.linux.slackware he advocates using
PGP because he wishes to curry favour with people in that group he
wishes to impress.

Keith Keller is a coward fit for killfiles.

For one, Keith Keller uses a real name.
So: who's a coward?
 
R

rrrrrr rrrrrrrr

Josef Moellers said:
rrrrrr said:
Keith Keller <[email protected]> trolled:

[coward's words deleted]

Keith Keller hides his PGP in this group to curry favour with
people he wishes to impress. In alt.os.linux.slackware he
advocates using PGP because he wishes to curry favour with
people in that group he wishes to impress.

Keith Keller is a coward fit for killfiles.
For one, Keith Keller uses a real name.

It may be a real name. But it's not his name.

Keith Keller is a coward and a hypocrite who currys favour.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top