永久地“全球” ? [英] Permanently "global" ?

查看:66
本文介绍了永久地“全球” ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数组/哈希,存储我的应用程序的路径信息。如在,

这个目录是什么,在什么目录中,该网站的名称是什么?b $ b,产品被叫什么等等。 '$ glb。


所以,到目前为止,每个函数都是这样的:


函数(){

全球$ glb;

}


一遍又一遍


如何制作$ glb总是全球化?我假设有这样的方式

这样做,否则让我知道,我会跳出这个

语言并跑回家去perl 。


谢谢

mrb


----------- -------------------------------

签名:

从不购买newsfeed.com的服务。我是一个付费用户,但是

我正在使用谷歌发帖子,所以我可以避免他们该死的

广告出现在我发的每个帖子中。 />
------------------------------------------

解决方案

glb。


因此,到目前为止,每个函数都是这样的:

函数(){

global


glb;

}


一遍又一遍


如何制作


glb永远是全球性的?我假设有这样的方式

这样做,否则让我知道,我会跳出这个

语言并跑回家去perl 。


谢谢

mrb


----------- -------------------------------

签名:

从不购买newsfeed.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.
------------------------------------------

解决方案

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.
------------------------------------------


这篇关于永久地“全球” ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆