Mega Code Archive

 
Categories / Perl / File
 

Read the first line of a local file

#!/usr/bin/perl use IO::File; my $file = "yourFile.txt"; my $fh   = IO::File->new($file); my $line = <$fh>; print $line;