Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errata Tk->findINC usage in demo instead of Tk->findINC #30

Open
bzimage-it opened this issue Feb 9, 2018 · 1 comment
Open

errata Tk->findINC usage in demo instead of Tk->findINC #30

bzimage-it opened this issue Feb 9, 2018 · 1 comment

Comments

@bzimage-it
Copy link

my /usr/lib/x86_64-linux-gnu/perl5/5.22/Tk.pm shows to me:


sub findINC
{
 my $file = join('/',@_);
 my $dir;
 $file  =~ s,::,/,g;
 foreach $dir (@INC)
  {
   my $path;
   return $path if (-e ($path = "$dir/$file"));
  }
 return undef;
}

Since it has not the my $self = shift; instruction at the beginning it seems to be used with :: operator, not with -> ;

however the 'demo' directory examples widely use the -> in fact:


$ cd /usr/lib/x86_64-linux-gnu/perl5/5.22/Tk/demos
$ grep -ri '>findINC' . | wc
     37     195    3196
$ grep -ri ':findINC' . | wc
      0       0       0
$ 

I suppose the bug is in demo files due findINC shall be static as defined.

@chrstphrchvz
Copy link
Contributor

@bzimage-it I think you meant to put "instead of Tk::findINC" in the title of this issue.

Indeed the only example of Tk::findINC I found in the Perl/Tk distribution is in t/zzPhoto.t.

I'm not familiar with using findINC, but according to Mastering Perl/Tk §13.24 "Really Miscellaneous Methods", there is (or was) a distinction between using Tk::findINC and Tk->findINC:

Tk->findINC searches for files in all Tk subdirectories of the current @INC path. […] If using the form Tk::findINC, then only @INC is searched, not the subdirectories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants