File::Slurp::Unicode is a Perl module that wraps File::Slurp and adds character encoding support through the encoding parameter. It exports the same functions which take all the same parameters as File::Slurp. Please see the File::Slurp documentation for basic usage; only the differences are described from here on out.
SYNOPSIS
use File::Slurp::Unicode;
my $text = read_file('filename', encoding => 'utf8');
my @lines = read_file('filename'); # utf8 is assumed if no encoding.
write_file('filename', { encoding => 'utf16' }, @lines);
# same as File::Slurp::write_file (ie. no encoding):
write_file('filename', { encoding => 'binary' }, @lines);
use File::Slurp::Unicode qw(slurp);
my $text = slurp('filename', encoding => 'latin1');
Product's homepage
Requirements:
· Perl