Sorry for confusing and I am new to Perl scripting and I am writing a script to read a file which has the employee info, here is the table
I wan be able to read only both names.
This is a cross post of the Perl Gurus forum. Please refer to it for better programming practices.
The requirement is slightly clearer here than on the Perl Gurus forum, but I still don't know clearly what you really want to print.
Looking at your command line, I doubt that this prints anything, because "-n" cannot be equal to "n".
Also, at ther very least, change:
to something like
Otherwise, it won't even compile.
Having made all the necessary corrections, the program should print the first word of each line.