open ( FILE, $file{in} ) or die "can't open it:$!\n"; my @targets = < FILE >; close FILE; foreach my $target ( @targets ) { #### processing }