http://qs1969.pair.com?node_id=491165


in reply to Overriding 'use'?

There are several theories about how to tell when a builtin is overridable, for example if prototype 'CORE::foo' is defined foo is overridable. That's mostly true, but there are exceptions.

Here's a quick way to tell:

$ perl -e'BEGIN{ *CORE::GLOBAL::use = sub{1};} use CGI qw/:standard/; +print header' Content-Type: text/html; charset=ISO-8859-1 $
The override didn't take, so use is what it is.

A simpler version:

$ perl -e'use Fatal qw/use/;' Cannot make a non-overridable builtin fatal at /usr/lib/perl5/5.8.4/Fa +tal.pm line 108. BEGIN failed--compilation aborted at -e line 1. $
Unfortunately, Fatal uses the defined prototype rule to decide that.

After Compline,
Zaxo