while () { next if /^#/; my ($infile, $dir, $type) = split; print "$infile $dir $type\n"; } #### while () { next if /^#/; my @split = (split)[0..2]; print "@split\n"; }