in reply to Adding to variable with sprintf()

$page_data = "the cow jump over the moon"; $new = join(" ", grep { length($_) > 3} split(/\s/, $page_data)); print $new;
See perlfunc manpages of split,join and grep for how this works, basically:

Replies are listed 'Best First'.
Re^2: Adding to variable with sprintf()
by trammell (Priest) on Apr 28, 2005 at 04:01 UTC
    Slightly cleaner:
    $new = join ' ', grep length > 3, split ' ', $page_data;