Re: Remove last 10 lines of all files in a directory
- From: "DJ Stunks" <DJStunks@xxxxxxxxx>
- Date: 26 Sep 2006 14:41:15 -0700
usenet@xxxxxxxxxxxxxxx wrote:
DJ Stunks wrote:
$#file -= 10;
Hey, no kidding? I never realized $#foo could be assigned to... that's
a neat trick.
yeah, it is.
>>>>> "pd" == perldoc perldata writes:
pd> The length of an array is a scalar value. You may find
pd> the length of array @days by evaluating $#days, as in
pd> csh. However, this isn't the length of the array; it's
pd> the subscript of the last element, which is a different
pd> value since there is ordinarily a 0th element. Assigning
pd> to $#days actually changes the length of the array.
pd> Shortening an array this way destroys intervening values.
pd> Lengthening an array that was previously shortened does
pd> not recover values that were in those elements. (It used
pd> to do so in Perl 4, but we had to break this to make
pd> sure destructors were called when expected.)
-jp
.
- References:
- Remove last 10 lines of all files in a directory
- From: rsarpi
- Re: Remove last 10 lines of all files in a directory
- From: usenet
- Re: Remove last 10 lines of all files in a directory
- From: DJ Stunks
- Re: Remove last 10 lines of all files in a directory
- From: usenet
- Remove last 10 lines of all files in a directory
- Prev by Date: Re: Standard input errors
- Next by Date: Re: Standard input errors
- Previous by thread: Re: Remove last 10 lines of all files in a directory
- Index(es):
Relevant Pages
|