At 12:44 AM 6/28/01 +0200, Jos I. Boumans wrote:
>use strict;
>require 'config.pl';
>use vars qw($usr $pwd $host);
>print $usr, $pwd, $host;
>
>this runs with no errors whatsoever....
>
>what i DO want is a trailing ' at the "$pwd = 'bar'; " thing

Sigh, yeah... two mistakes in one hour.  Because the strictness is 
lexically scoped and therefore doesn't extend to config.pl.  I'm just used 
to putting "use strict" into every file and requiring them at compile time, 
is all.

>Jos
>
>----- Original Message -----
>From: "Peter Scott" <[EMAIL PROTECTED]>
>To: "Jos I. Boumans" <[EMAIL PROTECTED]>; "Tim Musson" <[EMAIL PROTECTED]>;
><[EMAIL PROTECTED]>
>Sent: Thursday, June 28, 2001 12:37 AM
>Subject: Re: Re[3]: Best practice for config file use?
>
>
> > At 12:15 AM 6/28/01 +0200, Jos I. Boumans wrote:
> >
> > >1.    script that holds global vars, let's call it config.pl
> > >
> > >### config.pl ###
> > >$usr = 'foo';
> > >$pwd = 'bar;
> > >$host = 'bleh.com';
> > >
> > >### in your script you'd say: ###
> > >require 'config.pl'
> > >use vars qw($usr $pwd $host); #these 3 vars are 'used' by your config
>file,
> > >thus poluting your namespace that way
> >
> > I think you want the "usr vars" to precede the "require".
> > --
> > Peter Scott
> > Pacific Systems Design Technologies
> > http://www.perldebugged.com
> >
> >

--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com

Reply via email to