#!/usr/bin/perl # Namecheck Program $n = 0; #this is what we will increment to go throug the list $name = 'Defined Name list'; # Name of the file $newName = 'name list to check defined list again'; # Name of the second file open(Definedlist, $name); # opens the file and places the contents into Namelist open(BigNamelist, $newName); # opens the second file and places the contents into Newlist @firstArray = ; # Read it into an array @secondArray = # Read it into the second array close(Namelist) || die("Namelist Problem, stopped"); # Close the file close(Newlist) || die("Newlist Problem, stopped"); # Close the file foreach $Nameline (@secondArray) # go through each item in array inside the document { egrep @firstArray[$n++] < $Nameline > newName.txt # go through array one and print all the names with that name e.g (shaun is chosen so print out all the details of that line inside the new document) } TEST DATA __Definedlist__ Test Mai Program please __BigNamelist__ test has scored 20 today with his program and around the world the program worked this is a stick situation Mai