[EMAIL PROTECTED] said:

> if you do:
> perl -e '$a="beta"; *$a=sub{print("xxx")}; beta()'
> works and print "xxx"
>
> if you do:
> perl -e 'use strict; my $a="beta"; *$a=sub{print("xxx")}; beta()'
> don't works
>
> Who do I resolve this problem

Don't use strict.

Or more specifically, don't use strict refs.

The strict pragma is there to tell you when you are doing something that
might be a mistake.  If it's not a mistake, don't ask strict to complain
when you do it.

There are ways that you can do what you want with strict in force, but why
bother.  You can turn off strict refs just for the part of your program
where you don't want it.  Don't make your life and your programs harder
than they need to be.


-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to