in reply to bullet proof SLURP file

Shouldn't something like this catch them all?

#!/usr/bin/env perl use strict; use warnings; use Path::Tiny; use Try::Tiny; use autodie qw(:all); use feature qw(say); my $file = shift; try { say path($file)->slurp_utf8; } catch { print $_; }; __END__

I'm not sure. And even worse: I have no idea for the moment/in a hurry how to test it.

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

Replies are listed 'Best First'.
Re^2: bullet proof SLURP file
by haukex (Archbishop) on Jan 09, 2018 at 21:53 UTC
    Shouldn't something like this catch them all?

    Doesn't look like it, sorry :-( A look at the Path::Tiny source shows it seems to do no error checking on the reads at all.

      Too bad ;-[. And i need a while to digest the code you provided.

      Thanks and 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