NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
*cry* (Score:1)
Re:*cry* (Score:2)
That's the plan.
If you look at the Makefile.PL for UNIVERSAL::require [cpan.org] you'll notice logic in there which checks if the currently installed version of the module is older than the last API change. If so, it warns about the API change and sleeps for a moment so there's a hope of it being seen. Additionally, I'll put this warning in the version
Re:*cry* (Score:1)
Re:*cry* (Score:2)
What happens? Thus is the curse of UNIVERSAL. I also can't use a different package name, such as UNIVERSAL::use or UNIVERSAL::load, if its going to have a require() method because then UNIVERSAL::require and UNIVERSAL::use could not be used together in the same package.
Re:*cry* (Score:2)
storm of protest (Score:1)
Not a fan of this change. What's wrong with saying
$foo->require or die $@;That's not too much to type. It breaks this kind of useful idiom:$this->require or $that->require or die "No alternatives found: $@";and it breaks this kind of portability even moreIt also makes it difficult to write a custom error message - I have to wrap the call in an eval, and so we're back where we starte
Re:storm of protest (Score:1)
No we're not. Now you're wrapping it in eval{}, not in eval "". That's a big win.
rjbs
Re:storm of protest (Score:1)
use Module::Load;
my $module = 'Data:Dumper';
load Data::Dumper; # loads that module
load 'Data::Dumper'; # ditto
load $module # tritto
You can read the docs here [cpan.org]
Re:storm of protest (Score:1)
eval { $fooo->require }. The only win here is if we declared$foo, not$fooo.eval { $foo->reqiure }is still a runtime error.Re:storm of protest (Score:2)
Its not about the amount of typing (well... part of it is). Its about the expectation that require() should die. Even *I'm* surprised to find out that $foo->require doesn't die and I WROTE THE MODULE!
Error checking should be something you turn off, not something you turn on. Especially when it comes to dealing with the World Outside Your Program. Files, networks, etc... things not totally under your program's control a
Er... all of them? (Score:1)
Er... are you assuming that all users of UNIVERSAL::require have their code on CPAN?
Re:Er... all of them? (Score:1)
Re:Er... all of them? (Score:1)
Re:Er... all of them? (Score:1)
You want us to drop every silly web application we've ever written for every client into CPAN?
Stuff that contains business logic that only applies to a guava farmer working in the north-western tasmania local government area of Tasman, who uses Quickbooks and has Internet Explorer specific functionality?
Re:Er... all of them? (Score:2)
Re:Er... all of them? (Score:1)
I might be getting something wrong, though, and I'm not sure whether you'd be able to prevent the instalation from within Makefile.PL. Probably.
Re:Er... all of them? (Score:2)
There is t
Re:Er... all of them? (Score:1)
There is the simple expedient of just not producing a Makefile.
Indeed
Re:Er... all of them? (Score:2)
In that case then its being installed as a dependency of something which itself has not yet been installed. When the dependent thing gets installed its own tests will run and detect if the incompatibility caused a problem.
Oh... you do have tests, right?
Re:Er... all of them? (Score:1)
That, however, poses a problem, as the module was already installed... but maybe you can somehow detect, er... something else O:-)