Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Overriding 'use'?

by Zaxo (Archbishop)
on Sep 12, 2005 at 06:52 UTC ( [id://491165]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://491165]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (10)
As of 2024-04-18 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found