3 CORE - Virtual namespace for Perl's core routines
9 *CORE::GLOBAL::hex = sub { 1; };
12 print hex("0x50"),"\n"; # prints 1
13 print CORE::hex("0x50"),"\n"; # prints 80
17 The C<CORE> namespace gives access to the original build-in functions from
18 Perl. There is no C<CORE>-package, and therefore you do not need to use or
19 require the CORE-module prior to accessing routines in this namespace.
21 A list of the build-in functions in Perl can be found in L<perlfunc>.
23 =head1 OVERRIDING CORE FUNCTIONS
25 The C<CORE::GLOBAL> namespace allows you to override the Perl build-in
26 routines with your own version:
28 *CORE::GLOBAL::hex = sub
33 The new routine will be called whenever a build-in function is called
34 without a qualifying package:
36 print hex("0x50"),"\n"; # prints 1
38 If you want access to the original, unaltered routine, use the C<CORE::>
41 print CORE::hex("0x50"),"\n"; # prints 80
45 Tels <nospam-abuse@bloodgate.com> 2007.