while() { @line = split '|'; # split line $firstLetter = substr $line[1], 0, 1; #grab first letter $lastName = (split(' ', $line[1]))[1]; #split the name entry on whitespace and grab the last name portion $name = $firstLetter . ". " . $lastName; #concatenate with period after first letter }