open(FILE, "<", "x.log") or die "unable to open x.log $!"; while my $line () { ... process each $line... }