X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldata.pod;h=8e2e177e33ce2d23949acd13e5eb865fef81bf77;hb=d360a069d6bdc55d9bfda16507abbff2168bf4f7;hp=3e2482e7847047e7a244efc69823bf6e89f3a385;hpb=7e3b091dcbe93a1c94db1d9abc2570cf54821a92;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldata.pod b/pod/perldata.pod index 3e2482e..8e2e177 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -219,7 +219,7 @@ an array that was previously shortened does not recover values that were in those elements. (It used to do so in Perl 4, but we had to break this to make sure destructors were called when expected.) -You can also gain some miniscule measure of efficiency by pre-extending +You can also gain some minuscule measure of efficiency by pre-extending an array that is going to get big. You can also extend an array by assigning to an element that is off the end of the array. You can truncate an array down to nothing by assigning the null list @@ -416,8 +416,8 @@ plain paranoid, you can force the correct interpretation with curly braces as above. If you're looking for the information on how to use here-documents, -which used to be here, that's been moved to L in the section on -L. +which used to be here, that's been moved to +L. =head2 List value constructors @@ -636,7 +636,7 @@ The previous assignments are exactly equivalent to ($days[3], $days[4], $days[5]) = qw/Wed Thu Fri/; ($colors{'red'}, $colors{'blue'}, $colors{'green'}) = (0xff0000, 0x0000ff, 0x00ff00); - ($folks[0], $folks[-1]) = ($folks[0], $folks[-1]); + ($folks[0], $folks[-1]) = ($folks[-1], $folks[0]); Since changing a slice changes the original array or hash that it's slicing, a C construct will alter some--or even all--of the @@ -759,6 +759,11 @@ that must be passed around, as in the following example: # $f implicitly closed here } +Note that if an initialized scalar variable is used instead the +result is different: C is equivalent +to C. +C forbids such practice. + Another way to create anonymous filehandles is with the Symbol module or with the IO::Handle module and its ilk. These modules have the advantage of not hiding different types of the same name