[tex-live] Patch to updmap.pl
Joachim Schrod
jschrod at acm.org
Mon Sep 3 14:55:17 CEST 2007
Jjgod Jiang wrote:
> $mode = &cfgval("LW35");
> - $mode = "URWkb" if ($mode = undef);
> + $mode = "URWkb" if ($mode eq undef);
>
> $dvipsPreferOutline = &cfgval("dvipsPreferOutline");
> $dvipsPreferOutline = 1 if ($dvipsPreferOutline eq undef);
I can't comment on the patch, but on this piece of Perl code: all
occurences of
if ($somevar eq undef)
should definitively be replaced by
if ( ! defined($somevar) )
The current comparison does NOT test if the variable is undef. It
tests if it is undef _or_ the empty string, since both operands of
eq are coerced to strings first. (If one really wants to test on
undef or the empty string, one should better use $somevar eq "".)
While you're at it, you might want to discard the "&" in front of
the direct function call. That got unnecessary with Perl 5 more
than a decade ago.
Best,
Joachim
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod Email: jschrod at acm.org
Roedermark, Germany
More information about the tex-live
mailing list