Defining Global Variables w/use strict;

2001-11-08 Thread Tomasi, Chuck
System: Sun Ultra 2, Solaris 7 (11/99) Perl: 5.6.0 I have a series of related programs that need global definitions ($DOMAIN, $ADMIN, $DBNAME, etc). My code looks something like this: -- #!/usr/local/bin/perl -w use strict; use DBI; require "defs.pl"; print "Welcome t

Re: Defining Global Variables w/use strict;

2001-11-08 Thread dan radom
just a thought, but how can you print a variable that hasn't been defined yet? dan * Tomasi, Chuck ([EMAIL PROTECTED]) wrote: > System: Sun Ultra 2, Solaris 7 (11/99) > Perl: 5.6.0 > > I have a series of related programs that need global definitions ($DOMAIN, > $ADMIN, $DBNAME, etc). My code l

Re: Defining Global Variables w/use strict;

2001-11-08 Thread Etienne Marcotte
> -- > #!/usr/local/bin/perl -w > > use strict; > use DBI; > > require "defs.pl"; > > print "Welcome to $DOMAIN, $ADMIN\n"; > -- #!/usr/local/bin/perl -w use strict; use DBI; use defs; print "Welcome to defs::$DOMAIN, defs::$ADMIN\n"; --

Re: Defining Global Variables w/use strict;

2001-11-08 Thread Etienne Marcotte
He want's to take then in his global variables list.. where $DOMAIN is plexus.com and ADMIN is Chuck Etienne dan radom wrote: > > just a thought, but how can you print a variable that hasn't been defined yet? > > dan > > * Tomasi, Chuck ([EMAIL PROTECTED]) wrote: > > System: Sun Ultra 2, Sola

Re: Defining Global Variables w/use strict;

2001-11-08 Thread Jos I. Boumans
ovember 08, 2001 4:45 PM Subject: Defining Global Variables w/use strict; > System: Sun Ultra 2, Solaris 7 (11/99) > Perl: 5.6.0 > > I have a series of related programs that need global definitions ($DOMAIN, > $ADMIN, $DBNAME, etc). My code looks something like this: > >

RE: Defining Global Variables w/use strict;

2001-11-08 Thread Tomasi, Chuck
als I should have learned years ago. Thanks. > -Original Message- > From: dan radom [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 08, 2001 9:50 AM > To: '[EMAIL PROTECTED]' > Subject: Re: Defining Global Variables w/use strict; > > > just a thou

Re: Defining Global Variables w/use strict;

2001-11-08 Thread Jeff 'japhy' Pinyan
On Nov 8, Tomasi, Chuck said: >I have a series of related programs that need global definitions ($DOMAIN, >$ADMIN, $DBNAME, etc). My code looks something like this: Global variables aren't declared with my(). It sounds like you want to use the Exporter module. Your base program remains the sa

Re: Defining Global Variables w/use strict;

2001-11-08 Thread Peter Scott
At 11:06 AM 11/8/01 -0500, Jeff 'japhy' Pinyan wrote: >On Nov 8, Tomasi, Chuck said: > > >I have a series of related programs that need global definitions ($DOMAIN, > >$ADMIN, $DBNAME, etc). My code looks something like this: > >Global variables aren't declared with my(). It sounds like you want

Re: Defining Global Variables w/use strict;

2001-11-08 Thread Jeff 'japhy' Pinyan
On Nov 8, Peter Scott said: >> use DBI; >> use strict; >> require "defs.pl"; >> >> print "Welcome to $DOMAIN, $ADMIN\n"; > >Global symbol $DOMAIN requires explicit package name... Oops, that require() should have been inside a BEGIN { } block. >> package Defaults; >> require Exporte

Re: Defining Global Variables w/use strict;

2001-11-08 Thread Jeff 'japhy' Pinyan
On Nov 8, Arul, Rex said: >Import is redundant because, whenever you say, "use Defaults" it is akin >to a directive. Yes, use Module; becomes BEGIN { require Module; Module->import; } but we weren't use()ing the file. The bigger problem is that I called the import method from

[Fwd: Re: Defining Global Variables w/use strict;]

2001-11-08 Thread Arul, Rex
Jeff , Import is redundant because, whenever you say, "use Defaults" it is akin to a directive. So what it does implicitly is to invoke the "import" method of the module named "Defaults" . So when you say, "use strict;" or "use warnings;" , implicitly the "import" method of those modules are