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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|