sub file_processing { my ($array_ref, $script, $arg, $file) = @_; open(FILE, $script . ' ' . $arg . ' ' . $file . ' |') or die ("can't do it: $!\n"); while () { chomp; next if /^\#/; next if /none/i; next if /unkno/i; push @{$array_ref}, split ( /\n/, $_); } close FILE; }