BigHoss has asked for the wisdom of the Perl Monks concerning the following question:
Looking for an alternate. Here is the minimized test case. due to the nature of the original code, the "read()" of the file cannot be changed.
thanks in advance for any help...$ wc -c data 2753110808 data $ wc -l data 2753111 data
#!/usr/bin/perl $FILE = "data"; open (INFILE, "$FILE") || die "Not able to open the file: $FILE \n"; binmode INFILE; my $map; read(INFILE, $map, 2147483648); # Using this read instead, everything works. # read(INFILE, $map, 2147483630); BigParse($map); exit; sub BigParse { my $map = shift; print "string length = ", length($map), "\n"; # This fails with "Split loop" error message. foreach my $l (split("\n", $map)) { print $l; } return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parse string greater than 2GB
by rjt (Curate) on Jun 30, 2013 at 01:57 UTC | |
|
Re: Parse string greater than 2GB
by kcott (Archbishop) on Jun 30, 2013 at 02:15 UTC | |
|
Re: Parse string greater than 2GB
by thomas895 (Deacon) on Jun 30, 2013 at 02:44 UTC | |
by rjt (Curate) on Jun 30, 2013 at 09:32 UTC | |
|
Re: Parse string greater than 2GB
by Laurent_R (Canon) on Jun 30, 2013 at 08:22 UTC | |
|
Re: Parse string greater than 2GB
by swampyankee (Parson) on Jun 30, 2013 at 11:01 UTC | |
|
Re: Parse string greater than 2GB
by kcott (Archbishop) on Jul 04, 2013 at 01:31 UTC | |
|
Re: Parse string greater than 2GB
by locked_user sundialsvc4 (Abbot) on Jul 01, 2013 at 11:23 UTC |