in reply to Need Help on HTML::Parser

Yes, you can. Simply use anonymous sub:
$parser->handler(text => sub {text(@_, $text_to_match);},'self,text');