can we have that in writing.... account number 4567 7890 1234 5678
.... ok so thats not a real credit card but zero mine out just for the
laughs?
"Kipp, James"
<James.Kipp@m To: [EMAIL PROTECTED]
bna.com> cc:
Subject: RE: Head and Tail
06/22/01
02:03 PM
>>
> MBNA, eh? (japhy checks the credit card bills he
> receives...) ;) I guess
> it'd be in my best interest (no pun intended) to help you, then.
LOL !!! Actually I am a independent contractor, so I don't really work here
:-)
>
> Uri Guttman wrote File::ReadBackwards, available on CPAN,
> that can help
> you emulate tail(1).
Cool. I found a win32 Tail binary ported from GNU, but I rather stay away
from that route if I could.
>
> To emulate head(1), just read the first X lines of the file you want.
>
> DO NOT PUT THE FILE INTO AN ARRAY.
That is exactly what I was trying to avoid. So Just simply print the first
10 lines (records)?
> That is evil, as far as
> memory usage
> and efficiency go. (So it's evil, in general.)
I agree.
>
> use File::ReadBackwards;
>
> open HEAD, "< $file" or die "can't read $file: $!";
> for (1 .. 5) {
> push @head, scalar <HEAD>; # first 5 lines
> }
> close HEAD;
Ok, that is what I had in mind, just making sure there were not some better
ideas out there. This should work.
>
> tie *TAIL, 'File::ReadBackwards', $file or die "can't read
> $file: $!";
> for (1 .. 5) {
> unshift @tail, scalar <TAIL>; # last 5 lines
> }
> untie *TAIL;
>
> Notice how I unshift()ed to @tail -- this is so that the last
> 5 lines are
> stored in normal order in the array.
cool. Is the docs for this module available at CPAN ?
Thanks again.
If this works I will ZERO out your balance on your card .. :-)
JIm
>
>
------------------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.