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
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
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
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,
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
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
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.
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
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
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
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'
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
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
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
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
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
16 matches
Mail list logo