"Anthony E." wrote:
> 
> hello,

Hello,

> i have a bunch of text in a scalar $text
> How would I keep the word count to a maximum, and just
> dump the rest.. ie - I only want the paragraph to
> contain 500 words, and trash the rest.

my $new_text = join '', ($text =~ /(\s*\S+)/g)[0..499];


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to