For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > April 2005 > File::ReadBackwards, use integer









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author File::ReadBackwards, use integer
xhoster@gmail.com

2005-04-23, 3:57 pm

I'm having trouble using File::ReadBackwards on large files.

The problem is that the line:
my $read_size = $s_pos % $max_read_size || $max_read_size ;
yields -1 when $s_pos is large.

I've "solved" the problem by commenting out the line:
#use integer;


But I'm sure that "use integer" wasn't put there just be ornery, so now I
wonder what awful thing is going to happen because I commented it out.

Any thoughts?

Thanks,

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
Anno Siegel

2005-04-23, 8:56 pm

<xhoster@gmail.com> wrote in comp.lang.perl.misc:
> I'm having trouble using File::ReadBackwards on large files.
>
> The problem is that the line:
> my $read_size = $s_pos % $max_read_size || $max_read_size ;
> yields -1 when $s_pos is large.
>
> I've "solved" the problem by commenting out the line:
> #use integer;
>
>
> But I'm sure that "use integer" wasn't put there just be ornery, so now I
> wonder what awful thing is going to happen because I commented it out.


That "use integer" governs 220 lines of code. That's not a whole lot,
but it would be hard to find all places where "integer" might make a
difference. I'd ask Uri why it's there.

Even without looking at the code, "use integer" is likely to introduce a
2GB limit -- the documentation doesn't seem to mention such a thing.

Anno
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com