If I print the lines in the loop (commented out above) they are coming in as expected. When I print $wholeFile after the loop, only the last quarter or so of the file appears. The FRONT is somehow lopped off, in the middle of a plain text string. Any idea how this could happen?# call as: ConvertFindLaw.pl PilotLifeFindLaw.htm use 5.010; use Switch; use strict; my $wholeFile; my $INPUT_FILE = shift; my $FH; open(FH, $INPUT_FILE) or die "Bad $INPUT_FILE: $!"; ; foreach my $line (<FH>) { # print $line; # All lines printed # chomp $line; # this makes no difference to the problem $wholeFile .= $line; } # Build a long string close(FH); print $wholeFile; # front truncated here
In reply to string gets front truncated by hsfrey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |