X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlsub.pod;h=719197e57112b4ac84d763d0fb579642959cbabb;hb=cc7ef057bab1579c0576d0a578186a6e5ae298e2;hp=2b33bd89eb9b061a5dc556a697270ff1a92163eb;hpb=fd5a896ab6e0f1e056d0f4748a23c9379c27a3ae;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlsub.pod b/pod/perlsub.pod index 2b33bd8..719197e 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -220,9 +220,9 @@ Synopsis: my @oof = @bar; # declare @oof lexical, and init it my $x : Foo = $y; # similar, with an attribute applied -B: The use of attribute lists on C declarations is -experimental. This feature should not be relied upon. It may -change or disappear in future releases of Perl. See L. +B: The use of attribute lists on C declarations is still +evolving. The current semantics and interface are subject to change. +See L and L. The C operator declares the listed variables to be lexically confined to the enclosing block, conditional (C), @@ -325,14 +325,8 @@ it. Similarly, in the conditional the scope of $answer extends from its declaration through the rest of that conditional, including any C and C clauses, -but not beyond it. - -B The behaviour of a C statement modified with a statement -modifier conditional or loop construct (e.g. C) is -B. The value of the C variable may be C, any -previously assigned value, or possibly anything else. Don't rely on -it. Future versions of perl might do something different from the -version of perl you try it out on. Here be dragons. +but not beyond it. See L for information +on the scope of variables in statements with modifiers. The C loop defaults to scoping its index variable dynamically in the manner of C. However, if the index variable is @@ -686,7 +680,7 @@ subroutine never gets that chance. Consider; # set_arr_lv cannot stop this ! set_arr_lv() = { a => 1 }; - + =back =head2 Passing Symbol Table Entries (typeglobs) @@ -1157,8 +1151,8 @@ only occasionally and for good reason. Typically this might be done by a package attempting to emulate missing built-in functionality on a non-Unix system. -Overriding may be done only by importing the name from a -module--ordinary predeclaration isn't good enough. However, the +Overriding may be done only by importing the name from a module at +compile time--ordinary predeclaration isn't good enough. However, the C pragma lets you, in effect, predeclare subs via the import syntax, and these names may then override built-in ones: @@ -1265,7 +1259,7 @@ C replacement as C, it will actually receive the argument C<"Foo/Bar.pm"> in @_. See L. And, as you'll have noticed from the previous example, if you override -C, the C*E> glob operator is overridden as well. +C, the C<< <*> >> glob operator is overridden as well. In a similar fashion, overriding the C function also overrides the equivalent I/O operator C<< >>. @@ -1285,7 +1279,8 @@ been passed to the original subroutine. The fully qualified name of the original subroutine magically appears in the global $AUTOLOAD variable of the same package as the C routine. The name is not passed as an ordinary argument because, er, well, just -because, that's why... +because, that's why. (As an exception, a method call to a nonexistent +C or C method is just skipped instead.) Many C routines load in a definition for the requested subroutine using eval(), then execute that subroutine using a special @@ -1311,7 +1306,7 @@ even need parentheses: use subs qw(date who ls); date; who "am", "i"; - ls -l; + ls '-l'; A more complete example of this is the standard Shell module, which can treat undefined subroutine calls as calls to external programs. @@ -1360,7 +1355,7 @@ parsed and invoked: use attributes __PACKAGE__, \&plugh, q[Ugly('\(")], 'Bad'; For further details on attribute lists and their manipulation, -see L. +see L and L. =head1 SEE ALSO