local($/); my $data = ; while ($data =~ / \s*(?:-\s.\s-)? # eat up "- A -" \s*(\w+), # eats up spaces, last name in $1 \s(?:(\w+\.)\s)? # MI. in $2 (if any) (\w+) # first name in $3 \s*(\d+) # phone number in $4 \s+(\S+) # room number in $5 \s{1,6}(\S*) # grabs the next "close" string, ORG in $6 /sxg) { # store and/or check to see if this is our guy }