[PerlChina] 请教一个散列表的使用

jeffhua at aol.com jeffhua at aol.com
Thu Aug 10 06:45:11 PDT 2006


Yes,至少在modperl下是如此。
通常产品上线后,后关闭use warnings;否则日志里会一堆报警。

-----Original Message-----
From: poorest at gmail.com
To: china-pm at pm.org
Sent: Thu, 10 Aug 2006 9:21 PM
Subject:  Re: [PerlChina] 请教一个散列表的使用

I think to use warnings or not depends whether you are debugging  
yourself,
or you deliver to your client. For some stupid clients, I guess it would  
be
better to disable warnings in case of frightening.

-----Original Message-----
From: china-pm-bounces+poorest=gmail.com at pm.org
[mailto:china-pm-bounces+poorest=gmail.com at pm.org] On Behalf Of Qiang
(James) Li
Sent: Monday, August 07, 2006 11:46
To: china-pm at pm.org
Subject: Re: [PerlChina] 请教一个散列表的使用

On 8/4/06, 潘建锋 <panjianfeng1979 at gmail.com> wrote:
> 好像没有用,并且我已经用了
> use strict;
> 还需要用
> use warnings
> 吗?

yes. You should. and every Perl programmers should.

Qiang


> 2006/8/4, jeffhua at aol.com <jeffhua at aol.com>:
> > When you run the script with 'use warnings' you could get the  
errors:
> >
> > Modification of a read-only value attempted
> >
> > $1 is a special variable in Perl,you couldn't modify it using the
> > statement of '$1 = ...'.
> >
> >
> >
> >
> > -----Original Message-----
> > From: panjianfeng1979 at gmail.com
> > To: china-pm at pm.org
> > Sent: Fri, 4 Aug 2006 5:07 PM
> > Subject:  [PerlChina] 请教一个散列表的使用
> >
> > my %levelMap = (
> > 'PS_INDETERMINATE' => 9,
> > 'PS_CRITICAL' => 1,
> > 'PS_MAJOR' => 2,
> > 'PS_MINOR' => 3,
> > 'PS_WARNING' => 4
> > );
> > $1 = 'PS_MINOR';
> > 但是下面的语句老是报错
> > print $levelMap{$1};
> > 提示Use of uninitialized value in print ....
> > 请问是怎么回事?谢谢!
> >
> > _______________________________________________
> > China-pm mailing list
> > China-pm at pm.org
> > http://mail.pm.org/mailman/listinfo/china-pm
> >
> >
>  
________________________________________________________________________
> > Check out AOL.com today. Breaking news, video search, pictures,  
email
> > and IM. All on demand. Always Free.
> > _______________________________________________
> > China-pm mailing list
> > China-pm at pm.org
> > http://mail.pm.org/mailman/listinfo/china-pm
>
>
> _______________________________________________
> China-pm mailing list
> China-pm at pm.org
> http://mail.pm.org/mailman/listinfo/china-pm
>
_______________________________________________
China-pm mailing list
China-pm at pm.org
http://mail.pm.org/mailman/listinfo/china-pm

_______________________________________________
China-pm mailing list
China-pm at pm.org
http://mail.pm.org/mailman/listinfo/china-pm

________________________________________________________________________
Check out AOL.com today. Breaking news, video search, pictures, email  
and IM. All on demand. Always Free.


More information about the China-pm mailing list