my $file = "foo.txt"; open ($fh, $file) || die "Could not open file $file\n"; my $data; read($fh, $data, 1024);