in reply to Reference to functions in CORE:: pseudo package?
There is a highly magical way to override some core keywords. Here, I'll override glob to never find anything,
I tried printing the prototype of the builtin function to see if a prototype was needed to override.$ ls AGM AGM.pm foo $ perl -e'print prototype("CORE::glob"), $/' $ perl -e'{ local *CORE::GLOBAL::glob = sub {()}; while (<*>) {print " +Oh, No!\n"} } while (<*>){ print "Ha!\n"}' Ha! Ha! Ha! $
Unfortunately, print cannot be overridden. I told that tale in !Overriding Builtin print.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Reference to functions in CORE:: pseudo package?
by ysth (Canon) on Feb 02, 2004 at 02:41 UTC |