http://www.perlmonks.org?node_id=701429


in reply to string gets front truncated

Have you tried slurp mode? perlvar has this example:

open my $fh, "foo" or die $!; local $/; # enable localized slurp mode my $content = <$fh>; close $fh;

$/ is the input line separator. By having a local $/ undefined, the single line read, my $content = <$fh>; reads the whole file. If you're not doing anything to each line before putting it into your $wholeFile variable, then you may as well not think of the file as a set of lines and just read the whole file at once. You can see here how what you're trying to do might affect what kind of advice you might get.

If you still are thinking that you're missing the front of your file, then BrowserUK's explanation is probably the kind of thing to look for and you should prove it to yourself with graff's or ysth's approches of checking the length of your data or dumping to an output file.

update: I see where toolic pointed you to the slurp-mode solution in perlfaq5.


#my sig used to say 'I humbly seek wisdom. '. Now it says:
use strict;
use warnings;
I humbly seek wisdom.