sub { my $post_message = shift; $post_message=~ s/^\s*//; # leading spaces $post_message=~ s/\s*$//; # trailing spaces $post_message=~ s/\s+/ /g; # multiple spaces # # Strip HTML tags # $post_message=~ s(<[^>]*>)()g; $post_message=~ s(\[url.*\])()g; $post_message=~ s(\[\/url\])()g; $post_message=~ s(\[signature\])()g; $post_message=~ s(\[size*\])()g; # # Decode HTML encoded characters # $post_message=~ s(\<) (<)g; $post_message=~ s(\>) (>)g; $post_message=~ s(\&) (&)g; return substr($post_message,0,200); }