my $infile = $ARGV[0]; open my $inh, '<', $infile or die "Cannot open $infile for reading: $!"; my $xml; { local $/ = undef; $xml = <$inh>; } close $inh;