How to read only the first line of a file September 8, 2023 by Tarik open my $file, '<', "filename.txt"; my $firstLine = <$file>; close $file;