UNIVERSAL::require broke my tests

2007-02-28 Thread Ovid
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 qwno_such_function; print here; I run that and it prints 'here', even though HTML::TokeParser does not export 'no_such_function'. No

Re: UNIVERSAL::require broke my tests

2007-02-28 Thread Ovid
--- Ovid [EMAIL PROTECTED] wrote: #!/usr/bin/perl use strict; use warnings; use UNIVERSAL::require; use HTML::TokeParser qwno_such_function; print here; That produces: :!perl -Ilib parse.pl no_such_function is not exported by the HTML::TokeParser module

Re: UNIVERSAL::require broke my tests

2007-02-28 Thread Michael G Schwern
Its not UNIVERSAL::require, its UNIVERSAL (which UNIVERSAL::require must unfortunately load). use UNIVERSAL; use HTML::TokeParser qw(wibble); HTML::TokeParser defines nor inherits any import routine. When there's no import, any arguments to use are ignored and any calls to Class-import

Re: UNIVERSAL::require broke my tests

2007-02-28 Thread Rafael Garcia-Suarez
Michael G Schwern wrote in perl.qa : There is a fix for this, something like changing UNIVERSAL::import to be... sub import { my($class) = shift; return unless $class eq 'UNIVERSAL'; ...do the export... } Oh yes, that used to be a major *kh* problem. That's

Re: UNIVERSAL::require broke my tests

2007-02-28 Thread brian d foy
In article [EMAIL PROTECTED], Ovid [EMAIL PROTECTED] wrote: Note that the following does not trigger this: use UNIVERSAL::require; use CGI qwno_such_function; CGI has the nifty feature of auto-generating functions from its import list to turn them into HTML generating functions: use

UNIVERSAL::require broke my tests

2007-02-28 Thread Ovid
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 qwno_such_function; print here; I run that and it prints 'here', even though HTML::TokeParser does not export 'no_such_function'. No