in reply to How do i get the variables to actually get in here....

Actually, part of the problem seems to be your input data. Both 'name' and 'advisor' can consist of more than one name according to your example. Which raises the question: are the names always of the form 'lastname, firstname middlename'? What if a person has no middle name or more than one? In any case I don't see that your regex covers that.

Since this is a homework assignment, you probably can't change the input data (which is what I would normally do - use a separator like ':' to delimit the fields), so the way to go is probably:

- split at blanks (use  @a = /([\w-,@]+\s+)/)

- check which fields terminate in ',' - these are the last names of the person and his advisor

- check how many fields are between the person's last name and the advisor's last name and how many after the advisor's last name to find out how many first / middle names were given in each case

Hope this helps you,

pike