This was *real fun* to track down.  Here's a minimal test case of what
was happening:

  #!/usr/bin/perl 

  use strict;
  use warnings;

  use HTML::TokeParser qw<no_such_function>;

  print "here";

I run that and it prints 'here', even though HTML::TokeParser does not
export 'no_such_function'.  No errors or warnings produced.

Meanwhile, in code many modules away, UNIVERSAL::require is loaded and
my code goes boom!  Here's another minimal test case:

  #!/usr/bin/perl 

  use strict;
  use warnings;

  use UNIVERSAL::require;
  use HTML::TokeParser qw<no_such_function>;

  print "here";

That produces:

  :!perl -Ilib parse.pl
  "no_such_function" is not exported by the HTML::TokeParser module
  Can't continue after import errors at parse.pl line 7
  BEGIN failed--compilation aborted at parse.pl line 7.

So it's great that I can now easily track this sort of error down, but
it's not great that the code mysteriously stops working.

Cheers,
Ovid

--

Buy the book -- http://www.oreilly.com/catalog/perlhks/
Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/

Reply via email to