Re: Breaking up a large source file into several pieces

2002-09-20 Thread Cricker
Yes, I think I'm clear on this; at least I hope so after banging my head against Programming Perl 3. Globals are dynamically-scoped whereis lexicals only exist in the file where they are declared with my. Page 57 says: Because the file is the largest possible lexical scope, a lexically-scoped

Re: Breaking up a large source file into several pieces

2002-09-20 Thread drieux
On Friday, Sep 20, 2002, at 05:50 US/Pacific, Cricker wrote: [..] So what I was thinking of doing was something like: my ($a,$b); # main code ... #include subs1.pl ... where code in subs1.pl made reference to $a and $b. I realize that I can do this with globals. So that's what

Re: Breaking up a large source file into several pieces

2002-09-19 Thread Cricker
Drieux and the others who took the time to answer me: Thank you very much for your clear explanation. I am indeed in this for the long haul, so will accept your advice to spend the extra time now and write modules. I had actually settled on the last approach you mention, but now I see its

Re: Breaking up a large source file into several pieces

2002-09-19 Thread drieux
On Thursday, Sep 19, 2002, at 03:33 US/Pacific, Cricker wrote: [..] Thank you very much for your clear explanation. I am indeed in this for the long haul, so will accept your advice to spend the extra time now and write modules. I had actually settled on the last approach you mention,

Re: Breaking up a large source file into several pieces

2002-09-19 Thread Michael Fowler
On Thu, Sep 19, 2002 at 10:33:05AM -, Cricker wrote: If I may summarize -- and please correct me if this is wrong -- there is indeed no way to textually include one file inside another, like #include in C. As I mentioned previously in this thread, C is able to share its variables between

Breaking up a large source file into several pieces

2002-09-18 Thread Cricker
This seems like a stupid question... but I've looked in lots of places and can't figure it out. I'd like to break my perl script into several files (because it is getting awfully large, with all the callbacks from Tk), but still keep the lexical scope. Maybe I'm thinking too much like a C

Re: Breaking up a large source file into several pieces

2002-09-18 Thread Sudarshan Raghavan
On Tue, 17 Sep 2002, Cricker wrote: This seems like a stupid question... but I've looked in lots of places and can't figure it out. I'd like to break my perl script into several files (because it is getting awfully large, with all the callbacks from Tk), but still keep the lexical scope.

Re: Breaking up a large source file into several pieces

2002-09-18 Thread Cricker
Thanks, but I thought that modules were for submitting to CPAN. Don't I have to go through all the @ISA and Exporter:: stuff if I write a module? I would like to get away with something simpler. Thanks again. Sudarshan Raghavan [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL

Re: Breaking up a large source file into several pieces

2002-09-18 Thread Ramprasad A Padmanabhan
You can obviously write your own package files you must seriously consider 'perldoc perlmod' Cricker wrote: Thanks, but I thought that modules were for submitting to CPAN. Don't I have to go through all the @ISA and Exporter:: stuff if I write a module? I would like to get away with

Re: Breaking up a large source file into several pieces

2002-09-18 Thread Sudarshan Raghavan
On Wed, 18 Sep 2002, Cricker wrote: Thanks, but I thought that modules were for submitting to CPAN. No you can write modules for your own use too. Don't I have to go through all the @ISA and Exporter:: stuff if I write a module? I would like to get away with something simpler. That's

Re: Breaking up a large source file into several pieces

2002-09-18 Thread drieux
On Wednesday, Sep 18, 2002, at 05:12 US/Pacific, Cricker wrote: Thanks, but I thought that modules were for submitting to CPAN. a reasonable approach, in the long run, since you will find it easier to install for both yourself and everyone else, IF you build them in a way that is CPAN 'ready'

Re: Breaking up a large source file into several pieces

2002-09-18 Thread dan
i have a source code for a bot which is extremely huge. i split it up into several files, i.e: source1.pl source2.pl source3.pl etc.. and in the main executable file.. require(source1.pl); require(source2.pl); require(source3.pl); then run the main executable file, and it'll load each other

RE: Breaking up a large source file into several pieces

2002-09-18 Thread nkuipers
You don't need to write anything as a module per se. You can write a library instead, which merely contains the vars, subs and the like that you re-use often. Name it with a .pl extenstion. Then all you have to do is require /path/libname.pl; at the start of your code. -- To

Re: Breaking up a large source file into several pieces

2002-09-18 Thread Michael Fowler
On Tue, Sep 17, 2002 at 06:25:42PM -, Cricker wrote: I'd like to break my perl script into several files (because it is getting awfully large, with all the callbacks from Tk), but still keep the lexical scope. Maybe I'm thinking too much like a C programmer, but I would just like to

Re: Breaking up a large source file into several pieces

2002-09-18 Thread Michael Fowler
On Wed, Sep 18, 2002 at 12:12:34PM -, Cricker wrote: Thanks, but I thought that modules were for submitting to CPAN. Don't I have to go through all the @ISA and Exporter:: stuff if I write a module? I would like to get away with something simpler. Modules are for splitting code into

Re: Breaking up a large source file into several pieces

2002-09-18 Thread Dharmender Rai
you can try out : use, require and eval --- Cricker [EMAIL PROTECTED] wrote: This seems like a stupid question... but I've looked in lots of places and can't figure it out. I'd like to break my perl script into several files (because it is getting awfully large, with all the callbacks