in reply to Re^3: Write in files
in thread Write in files
defined checks whether or not a key is defined in a hash, in this context it will return true if the name was found in your file 1. lc turns a string into lower case, adding a bit of robustness to the code (I assumed you wanted to do case insensitive matching).
Generally, there is excellent documentation at http://perldoc.perl.org should you be unfamiliar with a specific function.
UPDATE: It seems I was a bit tired when writing in this thread. While defined does the job, one really should be using exists. Apologies! A simple introduction into hashes can be found here http://www.tutorialspoint.com/perl/perl_hashes.htm but googling "perl hash" will lead to many more good hits.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Write in files
by lolz (Initiate) on Nov 18, 2013 at 11:28 UTC | |
by hdb (Monsignor) on Nov 18, 2013 at 11:44 UTC |