#!/usr/bin/perl use warnings; use strict; my $file = '/foo/bar'; open my $fh, '<', $file or die $!; local $/; my $content = <$fh>; close $fh or die $! my $ascii = pack 'u', $content;