LA.pm: Re: Lurkers Anonymous
Samy Kamkar [CommPort5]
CommPort5 at LucidX.com
Tue Jul 3 13:56:42 CDT 2001
> Arkadiy Sudarikov wrote:
>
> my $truncated_text=$text=~ m/.{0, 250}\b/s;
You'll need to keep it
my ($truncated_text) = $text=~ m/(.{0, 250}\b)/s;
or it will return if it matched or not in $truncated_text...
> Ah, yes! But will $text be lexical too?
Yup, as long as you declared it with my
> And, no, it's gotta be $text < 250, because I don't want ... if it's
> empty string or if the original text it less than 250.
Ah, then you can just have it
$truncated_text .= '...' if length($text) < 250;
More information about the Losangeles-pm
mailing list