On Sat Nov 01 07:29:54 2008,
http://id.rambler.ru/users/hsw/ wrote:
Show quoted text> CGI::Utils::unescape() have:
> $EBCDIC = "\t" ne "\011";
> this variable set in begging of Utils.pm
I can confirm what you are reporting: #EBCIDIC is set at the top of
Utils.pm, and also calculated every time that unescape() is called.
However, I'm concerned about changing it because I'm afraid there's some
compatibility issue with having $EBCIDIC defined inside of the routine.
It certainly makes it a litlte easier to read when it doesn't refer to a
remote global variable.
What seems like perhaps a better idea to me is create a new routine:
sub _is_EBCIDIC {
$EBCIDIC = "\t" ne "\011" unless defined $EBCIDIC;
return $EBCIDIC;
}
It would be nice to get rid of the global variable completely, but that
doesn't seem possible unless you recalculate the value every time, or
only apply the optimization to OO calls, where we can stuff the stored
value in the object.
But all my talk is likely just premature optimization, since "\t" ne
"\011" likeely takes virtually no time to compute.
Mark