use File::Slurp 'read_file'; my $html = "/path/to/file.html"; my $str = read_file($html);