This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
legalize =begin foo bar
[perl5.git] / pod / perllexwarn.pod
index 20f1875..1eb8b30 100644 (file)
@@ -5,10 +5,12 @@ perllexwarn - Perl Lexical Warnings
 
 =head1 DESCRIPTION
 
-The C<use warnings> pragma is a replacement for both the command line
-flag B<-w> and the equivalent Perl variable, C<$^W>.
+The C<use warnings> pragma enables to control precisely what warnings are
+to be enabled in which parts of a Perl program. It's a more flexible
+alternative for both the command line flag B<-w> and the equivalent Perl
+variable, C<$^W>.
 
-The pragma works just like the existing "strict" pragma.
+This pragma works just like the C<strict> pragma.
 This means that the scope of the warning pragma is limited to the
 enclosing block. It also means that the pragma setting will not
 leak across files (via C<use>, C<require> or C<do>). This allows
@@ -212,8 +214,6 @@ The current hierarchy is:
 
   all -+
        |
-       +- assertions
-       |
        +- closure
        |
        +- deprecated
@@ -236,6 +236,8 @@ The current hierarchy is:
        |                |
        |                +- unopened
        |
+       +- imprecision
+       |
        +- misc
        |
        +- numeric
@@ -397,7 +399,7 @@ Consider the module C<MyMod::Abc> below.
     1;
 
 The call to C<warnings::register> will create a new warnings category
-called "MyMod::abc", i.e. the new category name matches the current
+called "MyMod::Abc", i.e. the new category name matches the current
 package name. The C<open> function in the module will display a warning
 message if it gets given a relative path as a parameter. This warnings
 will only be displayed if the code that uses C<MyMod::Abc> has actually
@@ -503,9 +505,9 @@ C<Derived>.
     use Original;
     use Derived;
     use warnings 'Derived';
-    my $a = new Original;
+    my $a = Original->new();
     $a->doit(1);
-    my $b = new Derived;
+    my $b = Derived->new();
     $a->doit(1);
 
 When this code is run only the C<Derived> object, C<$b>, will generate
@@ -516,21 +518,6 @@ a warning.
 Notice also that the warning is reported at the line where the object is first
 used.
 
-=head1 TODO
-
-  perl5db.pl
-    The debugger saves and restores C<$^W> at runtime. I haven't checked
-    whether the debugger will still work with the lexical warnings
-    patch applied.
-
-  diagnostics.pm
-    I *think* I've got diagnostics to work with the lexical warnings
-    patch, but there were design decisions made in diagnostics to work
-    around the limitations of C<$^W>. Now that those limitations are gone,
-    the module should be revisited.
-
-  document calling the warnings::* functions from XS
-
 =head1 SEE ALSO
 
 L<warnings>, L<perldiag>.