On 01/03/2014 10:22 AM, Janek Schleicher wrote:


A short look to CPAN brings out https://metacpan.org/pod/File::Inplace
what looks to do what OP wants.

Honestly I never used, and it can be that it has also a performance
problem, but for at least I looked to it's source code and it implements
it via a temporary file without saving the whole file.

i haven't seen that before but it was last touched in 2005. its api requires method calls to get each line, another method call to replace a line and such. i would call that somewhat clunky compared to edit_file_lines and its primary arg of a code block modifies $_. likely it will be much slower for typical files as well.

now for very large files, we can't tell. we still haven't heard back from the OP about the actual error. my conjecture of a resource limit still feels right. neither perl nor file::slurp would have any errors on a large file other than limited resources. and that can be fixed with a ulimit call or similar.

uri



--
Uri Guttman - The Perl Hunter
The Best Perl Jobs, The Best Perl Hackers
http://PerlHunter.com

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to