in reply to Re^2: how to split string(many words in one line) in a word?
in thread how to split string(many words in one line) in a word?

Sorry, but why split if you don't store it and join it directly? I know, it's the homework answer to split, but your's will be more efficient, I guess this way:
s/\s+/\n/;print;

$\=~s;s*.*;q^|D9JYJ^^qq^\//\\\///^;ex;print

Replies are listed 'Best First'.
Re^4: how to split string(many words in one line) in a word?
by GrandFather (Saint) on Oct 07, 2005 at 06:02 UTC

    Actually I don't think the homework required a split answer. But there is a tradition of providing a somewhat obscure answer to questions that look like homework. If OP asks questions, well and good. If not then they probably can't simply regurgitate the "answers" they have been given and expect to get good marks for it.


    Perl is Huffman encoded by design.