in reply to Re^4: Can't get the desired output..
in thread Can't get the desired output..
Recapping my understanding of your problem to see if I've it it right:
If you put names into a file one per line then your program can be used to tell you that a line contains a specific name and you can print just that name by printing the line from the file. However if you use a file containing lists of names then you get the whole line printed and that is not what you want.
However I suggest that isn't all your problem because you could just:
... if ($name =~ /Cobray/) { print "Cobray\n"; } ...
So what is the bigger picture? Where is your real problem?
|
|---|