On Mon, 31 Aug 2015 22:47:41 +0100, Dominic Hargreaves wrote: > > Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at > > /«PKG > > BUILDDIR»/versions/frame.pl line 357. > > It looks like perl's suggestion to omit defined may be wrong here, since > the code seems nonsensical, since $colorset is set to a scalar, and then > treated as an arrayref: > > sub check_frame_colorset { > [...] > local($colorset); > if ($reverse == 0) {$colorset="${which}_colorset"} > elsif ($reverse == 1) {$colorset="${which}_colorset_star"} > elsif ($reverse == 2) {$colorset="${which}_colorset_star_star"} > else {$colorset="${which}_colorset"} > if (!(defined @$colorset)) > { print STDERR "\nframes for $which are not supported\n"; return($rest);} > > [...] > > Possibly this should be replaced with "if (!(defined $colorset))" but I'd > like an opinion from someone who is more familiar with this codebase.
Agreed. Looking one step further it looks like the whole if is useless, since $colorset will always be defined by the if/elsif/else construct above. But I guess this code is trying to do something else, like checking if a specific ${which}_colorset exists. After digging a bit through the code, it looks like check_frame_colorset() is called with a $frame_implementation as the second parameter, and this can by either "W3C" or "Netscape", and then we find @Netscape_colorset* (but no @W3C_colorset*). So the code in check_frame_colorset() sets $colorset to either "Netscape_colorset*" or "W3C_colorset*" and then tries to check if an array with this name exists. And therefore I guess the line should be if (! @$colorset) Seems to work in a quick minimal test :) Cheers, gregor, preparing an NMU with this change -- .''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06 : :' : Debian GNU/Linux user, admin, and developer - https://www.debian.org/ `. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe `- NP: Funny Van Dannen: Plastikball
signature.asc
Description: Digital Signature