while(){ chomp; process_into_array($_); } sub process_into_array{ my $file=shift; open(DAT, $file); @file=(); }