Perhaps with something like this?:
#!/usr/bin/env perl use strict; use warnings; use Path::Tiny; use feature qw(say); use open ':encoding(UTF-8)'; my $file = q(data.txt); path($file)->spew_utf8(q(Lorem ipsum kizuaheli)); my $digest = qq($file\.digest); path($digest)->spew_utf8( path($file)->digest ); # path ($digest)->append_utf8("nose"); if ( path($file)->digest ne path($digest)->slurp_utf8 ) { say q(Something went wrong!); } else { my $fh = path($file)->filehandle( { locked => 1 }, "<" ); say <$fh>; } __END__
Not really tested. Just an idea.
Best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
In reply to Re^2: bullet proof SLURP file
by karlgoethebier
in thread bullet proof SLURP file
by leszekdubiel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |