perlmonknoob has asked for the wisdom of the Perl Monks concerning the following question:
so any help or a drection would be great my wise monks! thank you!#!/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 cont +ents into Namelist open(BigNamelist, $newName); # opens the second file and places the + contents into Newlist @firstArray = <Definedlist>; # Read it into an array @secondArray = <BigNamelist> # Read it into the second array close(Namelist) || die("Namelist Problem, stopped"); # Clo +se the file close(Newlist) || die("Newlist Problem, stopped"); # Close + the file foreach $Nameline (@secondArray) # go through each item in array insid +e the document { egrep @firstArray[$n++] < $Nameline > newName.txt # go through ar +ray 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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help from the Perliest monks
by kennethk (Abbot) on Jan 23, 2014 at 23:05 UTC | |
by perlmonknoob (Initiate) on Jan 24, 2014 at 00:11 UTC | |
|
Re: Help from the Perliest monks
by Laurent_R (Canon) on Jan 23, 2014 at 23:20 UTC | |
|
Re: Help from the Perliest monks (perlintro?)
by Anonymous Monk on Jan 23, 2014 at 22:24 UTC |