diff options
author | Tels <nospam-abuse@bloodgate.com> | 2007-07-09 19:28:43 +0200 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2007-07-09 18:25:29 +0000 |
commit | c8472d06082df3e0150ffe3794f2af69985f0f68 (patch) | |
tree | a20e594a734dfa75bf57dc133bd97b1c221a5a9c /lib/CORE.pod | |
parent | ff803615bbabee19929e775b766df9ea09c90a55 (diff) | |
download | perl-c8472d06082df3e0150ffe3794f2af69985f0f68.tar.gz |
CORE.pod
Message-Id: <200707091728.43634@bloodgate.com>
p4raw-id: //depot/perl@31574
Diffstat (limited to 'lib/CORE.pod')
-rw-r--r-- | lib/CORE.pod | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/CORE.pod b/lib/CORE.pod new file mode 100644 index 0000000000..c3c7c1f24c --- /dev/null +++ b/lib/CORE.pod @@ -0,0 +1,51 @@ +=head1 NAME + +CORE - Virtual namespace for Perl's core routines + +=head1 SYNOPSIS + + BEGIN + { + *CORE::GLOBAL::hex = sub { 1; }; + } + + print hex("0x50"),"\n"; # prints 1 + print CORE::hex("0x50"),"\n"; # prints 80 + +=head1 DESCRIPTION + +The C<CORE> namespace gives access to the original build-in functions from +Perl. There is no C<CORE>-package, and therefore you do not need to use or +require the CORE-module prior to accessing routines in this namespace. + +A list of the build-in functions in Perl can be found in L<perlfunc>. + +=head1 OVERRIDING CORE FUNCTIONS + +The C<CORE::GLOBAL> namespace allows you to override the Perl build-in +routines with your own version: + + *CORE::GLOBAL::hex = sub + { + # ... your code here + }; + +The new routine will be called whenever a build-in function is called +without a qualifying package: + + print hex("0x50"),"\n"; # prints 1 + +If you want access to the original, unaltered routine, use the C<CORE::> +prefix: + + print CORE::hex("0x50"),"\n"; # prints 80 + +=head1 AUTHOR + +Tels <nospam-abuse@bloodgate.com> 2007. + +=head1 SEE ALSO + +L<perl>, L<perlfunc>. + +=cut |