http://www.perlmonks.org?node_id=1026209


in reply to Re: Wrong idioms
in thread Wrong idioms

the problem with that is undef opens a temporary file

:) its http://search.cpan.org/perldoc/Dancer::FileUtils#read_file_content

sub open_file { my ( $mode, $filename ) = @_; open my $fh, $mode, $filename or raise core_fileutils => "$! while opening '$filename' using m +ode '$mode'"; return set_file_mode($fh); } sub read_file_content { my $file = shift or return; my $fh = open_file( '<', $file ); return wantarray ? read_glob_content($fh) : scalar read_glob_content($fh); }