my @files=<*.text>;#scans for .txt extensn in the curent dir local @_=@files; foreach my $file(<>) { chomp($file); ($name[$i],$value[$i])=split(",",$file); $i++; }