Good idea! I just wrote the following and am executing it as we speak (it's at 1_400_000 right now):
#!/usr/bin/perl
my $l=600_000;
while (1) {
print "\rTesting $l...";
open OUT,">biglines.txt" || die;
print OUT "x" x $l;
close OUT;
open IN,"<biglines.txt" || die;
my $r=<IN>;
close IN;
if (length($r)!=$l) {
print "Oops! A linelength of $l fails!!\n";
exit;
}
$l+=5000;
}
It doesn't have good resolution, but it would take it years to try all the possible lengths.
(12:01pm EST) Addendum: well, it's up to 25_000_000 characters on a line and still no problems!
(2:28pm EST) Well, I finally stopped it from executing at approximately 65MB per line :) At this point I'd say that there is no theorectical line-length-limit, at least under Linux. I would be interested, though, to see if Perl under NT lacks the same limitation.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.