[ic] Mike H, one step at a time

Jason Kohles interchange-users@interchange.redhat.com
Wed Mar 20 15:34:01 2002


On Wed, 2002-03-20 at 15:22, Jon Jensen wrote:
> On Wed, 20 Mar 2002, Steffen Dettmer wrote:
> 
> > * Paul Jordan wrote on Tue, Mar 19, 2002 at 20:23 -0800:
> > > >         my $docroot = $opt->{document_root} || $::Variable->{DOCROOT};
> > > >         my $server  = $opt->{server}   || $::Variable->{SERVER_NAME};
> > >
> > > Well, When I restarted interchange, I got some barewords errors, See I
> > > substituted www.imagemogul.com for SERVER_NAME.
> >
> > Try $::Variable->{'SERVER_NAME'}; SERVER_NAME is a string used as key
> > in a hashmap and here it seems to be undefined, and Perl doesn't know
> > if you mean a sub function or a string or what, since it's just a bare
> > word. Quoting is the correct usage of strings always, but if
> > SERVER_NAME if undefined, $server is undefined.
> 
> $::Variable->{SERVER_NAME} is fine, according to perlfaq7:
> 
> Do I always/never have to quote my strings or use semicolons and commas?
>
>
The key here is the statement "I substituted www.imagemogul.com for
SERVER_NAME", in this case it does need to be quoted, because
'www.imagemogul.com' is not a simple word by perls definition (simple
words are things that match \w).  That being said however, replacing
SERVER_NAME with www.imagemogul.com will not do anything like what you
think it will do and you should change it back.

-- 
Jason Kohles                                 jkohles@redhat.com
Senior System Architect
Red Hat Professional Consulting              http://www.redhat.com/