for my $i (2..12) { for my $k (5..18) { open my $handle, "<", "path" or die; # my means that the $handle here is a new one on each call. ... # closed is called automatically here } } #### my @columns = split(/\s+/, $line); # split columns on whitespace my $col1 = shift @columns; # column 1 (throw away) my $col2 = shift @columns; # column 2 (throw away) my $col3 = shift @columns; # column 3 (special - keep this one) my $result = sprintf("%8.3f", $col3); # special format for col 3