From 3a00d48b65ed450bb4958dac8f9c8637c5bbf515 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 27 Feb 2011 18:40:03 +0100 Subject: App::Dthumb::Data generator: Use IO::Handle --- lib/App/Dthumb/Data.pm.PL | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/App/Dthumb') diff --git a/lib/App/Dthumb/Data.pm.PL b/lib/App/Dthumb/Data.pm.PL index 1f04800..b07ed77 100644 --- a/lib/App/Dthumb/Data.pm.PL +++ b/lib/App/Dthumb/Data.pm.PL @@ -4,8 +4,8 @@ use warnings; use 5.010; use autodie; use MIME::Base64 qw(encode_base64); +use IO::Handle; -local $/ = undef; my ($out_file) = @ARGV; open(my $out_fh, '>', $out_file); @@ -19,6 +19,7 @@ for my $file (readdir($share_dh)) { } open(my $fh, '<', "share/${file}"); + $fh->input_record_separator(undef); my $content = <$fh>; close($fh); -- cgit v1.2.3 From 149e463ca5430c9327cbf4e516104bdc2dcea3ae Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 27 Feb 2011 18:43:45 +0100 Subject: "input_record_separator is not supported on a per-handle basis". Whoops. --- lib/App/Dthumb/Data.pm.PL | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/App/Dthumb') diff --git a/lib/App/Dthumb/Data.pm.PL b/lib/App/Dthumb/Data.pm.PL index b07ed77..a9e8ed8 100644 --- a/lib/App/Dthumb/Data.pm.PL +++ b/lib/App/Dthumb/Data.pm.PL @@ -4,7 +4,6 @@ use warnings; use 5.010; use autodie; use MIME::Base64 qw(encode_base64); -use IO::Handle; my ($out_file) = @ARGV; @@ -19,8 +18,7 @@ for my $file (readdir($share_dh)) { } open(my $fh, '<', "share/${file}"); - $fh->input_record_separator(undef); - my $content = <$fh>; + my $content = do { local $/ = undef; <$fh> }; close($fh); if ($file =~ qr{ \. (png | gif) $ }ox) { -- cgit v1.2.3