open FILEHANDLE, 'somefile.txt' or die $!; my $string = ''; while () { $string .= $_; }