in reply to Re^4: Removing AUTOLOAD from CGI.pm
in thread Removing AUTOLOAD from CGI.pm
> Not sure why AUTOLOAD is needed in CGI anyway, the allowed HTML-tags seem to be exported from CGI to the local namespace, but only spring into existence within the stash of %CGI:: after first use! Speed can't be that relevant, CGI doesn't do any syntax validation, so the same generic function could be installed at import time for all html-tags, maybe with a closed over $tag_name if necessary.
I believe the original reason was to defer the compilation so the majority of functions, not just html functions, were wrapped in quotes and then eval'd and added to the namespace when called. Or you could pass -compile (or call ->compile) to force them to compile at import time. It was kind of a way to fix the God object problem when compiling a 4000+ line module was slow. An added side effect was the ability to call CGI with arbitrary tags not included in the module... it was future proofed! You could call CGI->wibble and get a <wibble> tag.
Anyway it's all gone now, or soon will be.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Removing AUTOLOAD from CGI.pm
by LanX (Saint) on Feb 24, 2015 at 13:01 UTC | |
by LanX (Saint) on Feb 24, 2015 at 14:19 UTC | |
|
Re^6: Removing AUTOLOAD from CGI.pm (flexibility?)
by LanX (Saint) on Feb 24, 2015 at 16:42 UTC | |
by leej (Monk) on Feb 25, 2015 at 07:19 UTC | |
by LanX (Saint) on Feb 25, 2015 at 14:31 UTC | |
by leej (Monk) on Feb 26, 2015 at 07:05 UTC | |
by LanX (Saint) on Feb 26, 2015 at 14:01 UTC | |
|