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
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
> --
> #!/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";
--
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
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:
>
>
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
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
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
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
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
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
11 matches
Mail list logo