in reply to Parsing user input for AIM bot

It sounds like you are trying to write a chatbot type program... you may want to look at the following nodes:

Perl Alicebot?

Dueling Alicebots

And the following module:
Chatbot::Eliza
perl -e '$_=$0;split??;chop$_;$;=pop@_;$;++for(0..9060420);$_.=reverse +$;;print'