Re: How to create a package level variable

2007-08-24 Thread Jeff Pang
2007/8/24, Mr. Shawn H. Corey <[EMAIL PROTECTED]>: > Tom Phoenix wrote: > > Do you spell it initialised or initialized? > > Yes. > > british-english: initialise > american-english: initialize > But why not just spell it as init?for us both initialise and initialize are complicated,I can't remem

Re: How to create a package level variable

2007-08-24 Thread Chas Owens
On 8/24/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > Xavier Noria wrote: > > On Aug 24, 2007, at 8:13 PM, Dr.Ruud wrote: > > > >> "Chas Owens" schreef: > >> > >>> [$db_initiali.ed] > >>> Unless you have some funky source filter installed that normalizes > >>> spelling variants Perl is going

Re: How to create a package level variable

2007-08-24 Thread Chas Owens
On 8/24/07, Xavier Noria <[EMAIL PROTECTED]> wrote: > On Aug 24, 2007, at 8:13 PM, Dr.Ruud wrote: > > > "Chas Owens" schreef: > > > >> [$db_initiali.ed] > >> Unless you have some funky source filter installed that normalizes > >> spelling variants Perl is going to have a problem. > > > > Yes, I lik

Re: How to create a package level variable

2007-08-24 Thread Mr. Shawn H. Corey
Xavier Noria wrote: On Aug 24, 2007, at 8:13 PM, Dr.Ruud wrote: "Chas Owens" schreef: [$db_initiali.ed] Unless you have some funky source filter installed that normalizes spelling variants Perl is going to have a problem. Yes, I like the idea: use autocorect; I think there's an Acme::

Re: How to create a package level variable

2007-08-24 Thread Xavier Noria
On Aug 24, 2007, at 8:13 PM, Dr.Ruud wrote: "Chas Owens" schreef: [$db_initiali.ed] Unless you have some funky source filter installed that normalizes spelling variants Perl is going to have a problem. Yes, I like the idea: use autocorect; I think there's an Acme:: module that did somet

Re: How to create a package level variable

2007-08-24 Thread Dr.Ruud
"Chas Owens" schreef: > [$db_initiali.ed] > Unless you have some funky source filter installed that normalizes > spelling variants Perl is going to have a problem. Yes, I like the idea: use autocorect; (which of course corrects that line last, to signal that it's done) -- Affijn, Ruud "Ge

Re: How to create a package level variable

2007-08-24 Thread Chas Owens
On 8/24/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > Tom Phoenix wrote: > > Do you spell it initialised or initialized? > > Yes. > > british-english: initialise > american-english: initialize snip Yes, but in Perl you have to choose one and stick to it. The original code example was: p

Re: How to create a package level variable

2007-08-24 Thread Mr. Shawn H. Corey
Tom Phoenix wrote: Do you spell it initialised or initialized? Yes. british-english: initialise american-english: initialize -- Just my 0.0002 million dollars worth, Shawn "For the things we have to learn before we can do them, we learn by doing them." Aristotle "If you think Terra

Re: How to create a package level variable

2007-08-24 Thread Tom Phoenix
On 8/23/07, Sundeep <[EMAIL PROTECTED]> wrote: > $XYZ::db_initialised = 0; > > sub init_db() { > DB::init() unless $XYZ::db_initialized; > $XYZ::db_initialized = 1; > } Do you spell it initialised or initialized? Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-ma

Re: How to create a package level variable

2007-08-24 Thread Xavier Noria
On Aug 24, 2007, at 11:58 AM, Sundeep Gupta wrote: The problem was that this module (XYZ) module uses another module, which again has the use statement to load XYZ. I don't know if the perl loads the module again and might be this caused to reset the value back to 0. When I commented the use

Re: How to create a package level variable

2007-08-24 Thread Sundeep Gupta
Thanks Jeff, It works fine now. The problem was that this module (XYZ) module uses another module, which again has the use statement to load XYZ. I don't know if the perl loads the module again and might be this caused to reset the value back to 0. When I commented the use statement of that modul

Re: How to create a package level variable

2007-08-24 Thread Jeff Pang
2007/8/24, Sundeep <[EMAIL PROTECTED]>: > I need to have a package level variable. For that I am using the > following method: > > package XYZ; > > $XYZ::db_initialised = 0; > > sub init_db() { > DB::init() unless $XYZ::db_initialized; > $XYZ::db_initialized = 1; > } > > or > > package XY

How to create a package level variable

2007-08-24 Thread Sundeep
I need to have a package level variable. For that I am using the following method: package XYZ; $XYZ::db_initialised = 0; sub init_db() { DB::init() unless $XYZ::db_initialized; $XYZ::db_initialized = 1; } or package XYZ; my $db_initialised = 0; sub init_db() { DB::init() unle