1. while loop reading file line by line:
2. slurping all at once:my $xml; while (<SITE>) { $xml .= $_; }
I'd expect method 2 to be faster but I don't know if there are any other issues to consider. Thanks to anyone who has experience with this and cares to comment.my $xml; { local($/); undef $/; $xml = <SITE>; }
In reply to Reading entire file into scalar: speed differences? by theguvnor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |