RE: [tcltk-perl] return of 1=>1.0 transformation error
Brought to you by:
hobbs
From: Jan D. <ja...@Ac...> - 2004-04-28 17:05:51
|
> This is the exact code being run: > > my $row = 0; > foreach my $leaf('Tk.xbm','Xcamel.gif') > { > my $file = "./t/$leaf"; #Tk->findINC($leaf); > my $src = $mw->Photo(-file => $file); > ok(defined($src),1," Cannot load $file"); > my $kind = 'Initial'; > my $col = 0; > $mw->Label(-text => 'Initial') > ->grid(-row => $row, -column => $col); > $mw->Label(-background => 'white',-image => $src) > ->grid(-row => $row+1, -column => $col++); > ... > > We see that the problem is at -row 1, so that last line is the > issue. That this becomes SvNOK w/o being SvIOK in Perl 5.6 > seems "just wrong" to me (and obviously to others as 5.8 corrects > the issue). You guys are right that I should try without the > SvIOK as well, but still, this is a wacky promotion behavior. Perl 5.6.1 doesn't do anything weird there for me. Maybe it it the grid() method that modifies the SV? You can investigate this using Devel::Peek. It is not part of standard Perl, but you can install it with PPM for ActivePerl. Then insert require Devel::Peek; Devel::Peek::Dump($row); Before each usage of $row and see where things change. Cheers, -Jan |