sub left_subject{ my $self=shift; my $count=shift; use utf8; my $topic=$self->subject; utf8::decode($topic); utf8::upgrade($topic); my ($subtopic)=($topic=~/(.{0,$count})/); # utf8::decode($subtopic); $subtopic=~s/\b\w{1,5}$//; utf8::downgrade($subtopic); return $subtopic.'...'; }
You need to create an account or log in to post comments to this site.