Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Overriding 'use'?

by Zaxo (Archbishop)
on Sep 12, 2005 at 06:52 UTC ( #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? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2022-10-01 17:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (3 votes). Check out past polls.

    Notices?