http://qs321.pair.com?node_id=88825


in reply to Parsing Names in a Text File

Easy enough:
open(CUST, "cust_info.txt"); while (<CUST>) { print ((split ('\|'))[1], "\n"); }
Update: My apologies...even after reading the question twice before answering, I still missed what you were trying to do. :)
open(CUST, "cust_info.txt"); while (<CUST>) { $full_name = (split '\|')[1]; $full_name =~ s/(\w)\w*\s+(.+$)/$1. $2/; print $full_name, "\n"; }
is probably more what you're looking for.