Edit D:\app\Administrator\product\11.2.0\dbhome_1\perl\html\lib\CORE.html
<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>CORE - Pseudo-namespace for Perl's core routines</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:" /> </head> <body style="background-color: white"> <table border="0" width="100%" cellspacing="0" cellpadding="3"> <tr><td class="block" style="background-color: #cccccc" valign="middle"> <big><strong><span class="block"> CORE - Pseudo-namespace for Perl's core routines</span></strong></big> </td></tr> </table> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#synopsis">SYNOPSIS</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#overriding_core_functions">OVERRIDING CORE FUNCTIONS</a></li> <li><a href="#author">AUTHOR</a></li> <li><a href="#see_also">SEE ALSO</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <h1><a name="name">NAME</a></h1> <p>CORE - Pseudo-namespace for Perl's core routines</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> BEGIN { *CORE::GLOBAL::hex = sub { 1; }; }</pre> <pre> print hex("0x50"),"\n"; # prints 1 print CORE::hex("0x50"),"\n"; # prints 80</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>The <code>CORE</code> namespace gives access to the original built-in functions of Perl. There is no <code>CORE</code> package, and therefore you do not need to use or require an hypothetical "CORE" module prior to accessing routines in this namespace.</p> <p>A list of the built-in functions in Perl can be found in <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html">the perlfunc manpage</a>.</p> <p> </p> <hr /> <h1><a name="overriding_core_functions">OVERRIDING CORE FUNCTIONS</a></h1> <p>To override a Perl built-in routine with your own version, you need to import it at compile-time. This can be conveniently achieved with the <code>subs</code> pragma. This will affect only the package in which you've imported the said subroutine:</p> <pre> use subs 'chdir'; sub chdir { ... } chdir $somewhere;</pre> <p>To override a built-in globally (that is, in all namespaces), you need to import your function into the <code>CORE::GLOBAL</code> pseudo-namespace at compile time:</p> <pre> BEGIN { *CORE::GLOBAL::hex = sub { # ... your code here }; }</pre> <p>The new routine will be called whenever a built-in function is called without a qualifying package:</p> <pre> print hex("0x50"),"\n"; # prints 1</pre> <p>In both cases, if you want access to the original, unaltered routine, use the <code>CORE::</code> prefix:</p> <pre> print CORE::hex("0x50"),"\n"; # prints 80</pre> <p> </p> <hr /> <h1><a name="author">AUTHOR</a></h1> <p>This documentation provided by Tels <<a href="mailto:nospam-abuse@bloodgate.com">nospam-abuse@bloodgate.com</a>> 2007.</p> <p> </p> <hr /> <h1><a name="see_also">SEE ALSO</a></h1> <p><a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlsub.html">the perlsub manpage</a>, <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html">the perlfunc manpage</a>.</p> <table border="0" width="100%" cellspacing="0" cellpadding="3"> <tr><td class="block" style="background-color: #cccccc" valign="middle"> <big><strong><span class="block"> CORE - Pseudo-namespace for Perl's core routines</span></strong></big> </td></tr> </table> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de