QUOTE(CatchThi5Drift @ 4 Nov, 2009 - 05:40 PM)

CODE
# ($number, $email, $name) = ( split(/\s+/, $_) )[1,2,3]; this is the original line
($number, $email, $name) = ( split(/\t/, $_) )[1,2,3]; # changed s+ to t
Both versions of this line are broken.
The original version will put the email address into $number, the name into $email, and nothing into $name. $name being undef would presumably be the cause of your original batch of "uninitialized value" warnings. The reason it does this is because Perl array indexes are 0-based; if you're going to specify indexes to pull from, your data will be appearing in 0, 1, and 2, not 1, 2, and 3.
Your changed version puts nothing into any of the variables because you're splitting on tabs and the fields do not appear to be tab-separated, so the entire string ends up in element 0 of the list, which you aren't storing anywhere. This could just be an artifact of DIC turning your tabs into spaces, but, even if it is, there was no need to change from \s to \t.
Note also that the fields in the data file are ordered name, number, email. The correct version of this split statement would, therefore, be either
CODE
my ($number, $email, $name) = ( split(/\s+/, $_) )[1,2,0];
or (better)
CODE
my ($name, $number, $email) = ( split(/\s+/, $_) );
You're also missing the "last" in your "if address" and "if name" clauses, causing it to incorrectly claim that the customer was not found after printing the customer record.
Aside from that, it seems to work in the way you appear to have intended.
(And then there's "use strict", lexical filehandles and three-arg open (i.e., "open $ph, '<', 'customers.txt' or die..."), but I recognize that you're just going by the book here and I'm pretty sure I explained those to you before, so you already know about them for when you start writing your own Perl.

)