develooper Front page | perl.perl5.porters | Postings from February 2009

Bug in 'require Some::Package'?

Thread Next
February 15, 2009 15:11
Bug in 'require Some::Package'?
Message ID:
I *think* this is a bug, but I'm unsure of what's going on here:

  #!/usr/bin/perl -l
  print $::{'Foo::'} || 'Not found';
  eval "use Foo";
  print $::{'Foo::'} || 'Not found';
  eval "require Foo";
  print $::{'Foo::'} || 'Not found';

That prints:

  Not found
  Not found

In short, I'm getting a symbol table entry with a string eval of "require Foo" and not for "use Foo".

I would expect (hope?) for no symbol table entry at all.  I'm trying to auto-generate inheritance diagrams and this is causing false positives.  Is there some way of detecting that this package isn't really there?

  $ perl -v

  This is perl, v5.8.8 built for darwin-2level

Buy the book         -
Tech blog            -
Twitter              -
Official Perl 6 Wiki -

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About