while ( my $line = <$current_file> ) { ... } # $current_file can be a filehandle or an IO::File obejct # or anything else that responds appropriately in the < > # construct.