Hmm, never heard of printline in Perl, and that's a truely horrible substitution for the Perl example
a nicer (IMO) version of the Perl example:
Code:
my $s = "This is a string";
print join ' ', split /\s+/, $s;
or:
Code:
my @words = split /\s+/, "This is a string";
print join ' ', @words;
or if you want to do it on one line like the Ruby example:
Code:
print join ' ', split /\s+/, "This is a string";
or (almost) same thing:
Code:
print join ' ', split / /, "This is a string";
or same thing capturing the regex like the original example:
Code:
print join $1, split /(\s+)/, "This is a string";
or .... etc (TIMTOWTDI - in Perl

)
Edit: sorry, just realised your example said to print each word on its own line (though your Perl example didn't do that!!). In that case replace all
Code:
join ' '
in my examples with
Code:
join "\n"