#include equivalent?

H

Hagar

This question has probably come up a zillion times, but a search of this
group and Google has been somewhat ambiguous.

Is there a source "include" available for Perl, or a macro statement like
in assembler? I assume that there is not, at least by that topic, since I
can find nothing on the subject in my books.

I would assume that some Perl projects are fairly large and scrolling up
and down dozens or hundreds of screens trying to find that subroutine
would get old fairly fast.

It is easy enough to build a source joiner using several methods, but
being very new to Perl I was just wondering what the pros use to break up
their projects into managable pieces?

Hagar
 
H

Hagar

Yep, there are several ways, but look up the keyword "require", as in

require "./myprog.pl";

Remember that this is a scripting language, not an assembler where you can
tack on includes at the end. You need to require the program before you
use it.

DD


Thanks man! That worked. It is obvious that require is not exactly an
include and has some stuff that I don't understand yet, but it is close
enough. Thanks again.

Hagar
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top