Re: First attempt at writing simple Module

2009-03-27 Thread Dr.Ruud
Chas. Owens wrote: 2. package variables are always visible when fully qualified (i.e. $PKGNAME::varname), but the short name is only visible to the scope that contained the our statement and any nested scopes For example: { package Data::Dumper; our ($Indent, $Sortkeys, $Terse) = (1)x3

Re: First attempt at writing simple Module

2009-03-26 Thread Jenda Krynicky
From: "Chas. Owens" > On Wed, Mar 25, 2009 at 00:03, Chap Harrison wrote: > > Hi again, > > > > I'm trying to factor out the declaration and setting of a bunch of variables > > that a suite of programs will need, as well as defining some subroutines > > that will be needed.  I've been mainly refe

Re: First attempt at writing simple Module

2009-03-26 Thread Chas. Owens
On Thu, Mar 26, 2009 at 14:05, Chap Harrison wrote: snip > This one baffles me.  I still have to explicitly export $g_database_path by > putting it into @EXPORT - what is 'our' doing that 'my' doesn't? snip our and my both create variables. The difference is their scope and their interaction wit

Re: First attempt at writing simple Module

2009-03-26 Thread Chap Harrison
On Mar 25, 2009, at 1:16 AM, Chas. Owens wrote: You need to add the variables you want exported to either @EXPORT (the mandatory list of things to export) or @EXPORT_OK (this list of things to export on demand). The biggest complication is your desire to pass in a variable. This means that we

Re: First attempt at writing simple Module

2009-03-24 Thread Chas. Owens
On Wed, Mar 25, 2009 at 00:03, Chap Harrison wrote: > Hi again, > > I'm trying to factor out the declaration and setting of a bunch of variables > that a suite of programs will need, as well as defining some subroutines > that will be needed.  I've been mainly referencing Programming Perl 5, but I