"Ling F. Zhang" wrote:
>
> say I have a string scalar $s
> I would like to convert it @s in such a way that qw
> would do it...
> i.e.
> if $s = "rabbit hole\t goes\tall the way\n"
> then
> @s = ("rabbit","hole","goes","all","the","way\n")
@s = split ' ', $s;
> notice that I preserved the "\n" at the end, but I
> would settle for a solution that doesn't preserve
> it...thanx
If you want the same behaviour as qw() then the newline will be removed,
however you can append it later.
$s[ -1 ] .= "\n";
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]