Re: No Gtk2 and no Perl utf8 bug (was: Re: Something-else-than-utf8 bug (was: Re: utf8 bug ?))
- From: "A. Pagaltzis" <pagaltzis gmx de>
- To: Gtk-Perl-List <gtk-perl-list gnome org>
- Subject: Re: No Gtk2 and no Perl utf8 bug (was: Re: Something-else-than-utf8 bug (was: Re: utf8 bug ?))
- Date: Sun, 5 Sep 2004 15:30:41 +0200
* Jörn Reder <joern zyn de> [2004-09-05 10:21]:
We learn: don't struggle with globals! Use lexicals! ;)
Or remember local().
Try this:
sub replace { local $_ = shift; $_ }
Repeat after me:
Always localize $_.
Always localize $_.
Always localize $_.
There are so many cases where forgetting that has bitten someone
in this way or that.
Of course the same is true for other global special variables,
but $_ is the one used most of them all.
I didn't even notice this problem because I localize reflexively
these days and don't even think about it anymore. Consequently I
can't remember the last time I've had such a nasty surprise.
Regards,
--
Aristotle
"If you can't laugh at yourself, you don't take life seriously enough."
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]