my $fd_out = IO::File->new($what_file, 'r'); while (<$fd_out>) { # ... }