Hey guys, thanks for fast and useful answer :)
Worked perfectly. In case anyone would need it again :
print "Content-type: text/html\n\n";
$text = "Hello Bruce! It's so nice to meet you, pal, how've you been? I'm fine, and how are you?";
@words = split (/\s/,$text)...