#!/usr/bin/perl use CGI qw( header param ); use Chatbot::Eliza; sub parse { my $data = shift; $data =~ tr/A-Z/a-z/; my @junk = qw( am is are was were be been have has had do does did can should may might must shall should will would to of the i ); my $junk; foreach $junk(@junk) { $data =~ s/($junk | $junk)//g; } $data =~ s/(\.|!)//g; return $data; } print header; print "