Re: Permanently "global" ?
From: Chung Leong (chernyshevsky_at_hotmail.com)
Date: 02/16/04
- Next message: Joshua Beall: "Re: Page referer not getting set"
- Previous message: Chung Leong: "Re: Censor list words ?"
- In reply to: mrbog: "Permanently "global" ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 15 Feb 2004 21:32:47 -0500
What you have are constants. In general, it's best to avoid using variables
as constants (because variables are not constant). Constants always have
global scope.
You can't create your own super globals. You can hijack one of the existing
ones though:
$_ENV = $glb;
Uzytkownik "mrbog" <dterrors@hotmail.com> napisal w wiadomosci
news:cbd4bb52.0402141810.359d24c5@posting.google.com...
> I have an array/hash that stores path information for my app. As in,
> what directory this is in, what directory that's in, what the name of
> the site is, what the products are called, etc. It's called $glb.
>
> So, every function so far looks like this:
>
> function something() {
> global $glb;
> }
>
> over and over and over
>
> How do I make $glb just always be global? I'm assuming there's a way
> to do this, otherwise let me know and I'll parachute out of this
> language and run back home to perl.
>
> thanks
> mrb
>
>
>
>
> ------------------------------------------
> Signature:
> Never buy the services of newsfeed.com. I am a paying customer but
> I'm using google to post messages, so that I can avoid their damn
> advertisement showing up in every post I make.
> ------------------------------------------
- Next message: Joshua Beall: "Re: Page referer not getting set"
- Previous message: Chung Leong: "Re: Censor list words ?"
- In reply to: mrbog: "Permanently "global" ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|