Edit D:\app\Administrator\product\11.2.0\dbhome_1\perl\html\lib\strict.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>strict - Perl pragma to restrict unsafe constructs</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"> strict - Perl pragma to restrict unsafe constructs</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="#history">HISTORY</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <h1><a name="name">NAME</a></h1> <p>strict - Perl pragma to restrict unsafe constructs</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> use strict;</pre> <pre> use strict "vars"; use strict "refs"; use strict "subs";</pre> <pre> use strict; no strict "vars";</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>If no import list is supplied, all possible restrictions are assumed. (This is the safest mode to operate in, but is sometimes too strict for casual programming.) Currently, there are three possible things to be strict about: "subs", "vars", and "refs".</p> <dl> <dt><strong><a name="strict_refs" class="item"><code>strict refs</code></a></strong> <dd> <p>This generates a runtime error if you use symbolic references (see <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlref.html">the perlref manpage</a>).</p> </dd> <dd> <pre> use strict 'refs'; $ref = \$foo; print $$ref; # ok $ref = "foo"; print $$ref; # runtime error; normally ok $file = "STDOUT"; print $file "Hi!"; # error; note: no comma after $file</pre> </dd> <dd> <p>There is one exception to this rule:</p> </dd> <dd> <pre> $bar = \&{'foo'}; &$bar;</pre> </dd> <dd> <p>is allowed so that <code>goto &$AUTOLOAD</code> would not break under stricture.</p> </dd> </li> <dt><strong><a name="strict_vars" class="item"><code>strict vars</code></a></strong> <dd> <p>This generates a compile-time error if you access a variable that wasn't declared via <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#our"><code>our</code></a> or <code>use vars</code>, localized via <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#my"><code>my()</code></a>, or wasn't fully qualified. Because this is to avoid variable suicide problems and subtle dynamic scoping issues, a merely <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#local"><code>local()</code></a> variable isn't good enough. See <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#my">my in the perlfunc manpage</a> and <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#local">local in the perlfunc manpage</a>.</p> </dd> <dd> <pre> use strict 'vars'; $X::foo = 1; # ok, fully qualified my $foo = 10; # ok, my() var local $foo = 9; # blows up</pre> </dd> <dd> <pre> package Cinna; our $bar; # Declares $bar in current package $bar = 'HgS'; # ok, global declared via pragma</pre> </dd> <dd> <p>The <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#local"><code>local()</code></a> generated a compile-time error because you just touched a global name without fully qualifying it.</p> </dd> <dd> <p>Because of their special use by <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlfunc.html#sort"><code>sort()</code></a>, the variables $a and $b are exempted from this check.</p> </dd> </li> <dt><strong><a name="strict_subs" class="item"><code>strict subs</code></a></strong> <dd> <p>This disables the poetry optimization, generating a compile-time error if you try to use a bareword identifier that's not a subroutine, unless it is a simple identifier (no colons) and that it appears in curly braces or on the left hand side of the <code>=></code> symbol.</p> </dd> <dd> <pre> use strict 'subs'; $SIG{PIPE} = Plumber; # blows up $SIG{PIPE} = "Plumber"; # just fine: quoted string is always ok $SIG{PIPE} = \&Plumber; # preferred form</pre> </dd> </li> </dl> <p>See <a href="file://C|\ADE\aime_smenon_perl_090715\perl\html/pod/perlmodlib.html#pragmatic_modules">Pragmatic Modules in the perlmodlib manpage</a>.</p> <p> </p> <hr /> <h1><a name="history">HISTORY</a></h1> <p><a href="#strict_subs"><code>strict 'subs'</code></a>, with Perl 5.6.1, erroneously permitted to use an unquoted compound identifier (e.g. <code>Foo::Bar</code>) as a hash key (before <code>=></code> or inside curlies), but without forcing it always to a literal string.</p> <p>Starting with Perl 5.8.1 strict is strict about its restrictions: if unknown restrictions are used, the strict pragma will abort with</p> <pre> Unknown 'strict' tag(s) '...'</pre> <p>As of version 1.04 (Perl 5.10), strict verifies that it is used as "strict" to avoid the dreaded Strict trap on case insensitive file systems.</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"> strict - Perl pragma to restrict unsafe constructs</span></strong></big> </td></tr> </table> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de