Instead of using a well-documented, well-tested, well-deployed system, you created your own. Now you have to maintain it, update it, fix bugs, add features, and explain it to everyone who wants to use it.
That was the problem - which one? I had to delay that decision. If I was familiar enough with any of them I wouldn't even have thought of writing that module.
(Really, copying and pasting the source code of AutoLoader? It's core!)
AutoLoader doesn't support loading autosplit.al files which return an anonymous sub on require. If AutoLoader.pm were patched with the following
there would have been no need to borrow it's code other than by use. I could have written my own autoload sub, but copy & paste was quicker...--- AutoLoader.pm.orig 2006-06-18 16:18:30.000000000 +0200 +++ AutoLoader.pm 2006-06-18 16:20:10.000000000 +0200 @@ -89,7 +89,7 @@ } my $save = $@; local $!; # Do not munge the value. - eval { local $SIG{__DIE__}; require $filename }; + my $ref; $ref = eval { local $SIG{__DIE__}; require $filename }; if ($@) { if (substr($sub,-9) eq '::DESTROY') { no strict 'refs'; @@ -102,7 +102,7 @@ # There is a slight risk that we could pick up the wrong f +ile here # but autosplit should have warned about that when splitti +ng. if ($filename =~ s/(\w{12,})\.al$/substr($1,0,11).".al"/e) +{ - eval { local $SIG{__DIE__}; require $filename }; + $ref = eval { local $SIG{__DIE__}; require $filename } +; } } if ($@){ @@ -113,6 +113,7 @@ } } $@ = $save; + goto $ref if ref($ref) && ref($ref) eq 'CODE'; goto &$sub; }
thanks for the TechnicalDebt link.
--shmem
In reply to Re^2: RFC: Templating without a System
by shmem
in thread RFC: Templating without a System
by shmem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |