From: Gurusamy Sarathy Date: Fri, 21 Jan 2000 01:35:46 +0000 (+0000) Subject: mention the fact that open(my $foo, ...) covers all handle X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b1a9ed4a50dbd0c26cd6f3422bdf7a12d75292f7;p=p5sagit%2Fp5-mst-13.2.git mention the fact that open(my $foo, ...) covers all handle constructors p4raw-id: //depot/perl@4826 --- diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 9c040ed..15b60ba 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -447,16 +447,17 @@ See L and L for examples. The length argument of C has become optional. -=head2 Filehandles can be autovivified +=head2 File and directory handles can be autovivified Similar to how constructs such as C<$x->[0]> autovivify a reference, -open() now autovivifies a filehandle if the first argument is an -uninitialized variable. This allows the constructs C and -C to be used to create filehandles that will -conveniently be closed automatically when the scope ends, provided there -are no other references to them. This largely eliminates the need for -typeglobs when opening filehandles that must be passed around, as in the -following example: +handle constructors (open(), opendir(), pipe(), socketpair(), sysopen(), +socket(), and accept()) now autovivify a file or directory handle +if the handle passed to them is an uninitialized scalar variable. This +allows the constructs such as C and C +to be used to create filehandles that will conveniently be closed +automatically when the scope ends, provided there are no other references +to them. This largely eliminates the need for typeglobs when opening +filehandles that must be passed around, as in the following example: sub myopen { open my $fh, "@_"