in reply to Re: LCS efficiency problem
in thread LCS efficiency problem

split(/\s+/, $s) is surely better than split(/ /, $s).

Why? Are you forgetting that split / /, $s is magical?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^3: LCS efficiency problem
by ikegami (Patriarch) on Jun 05, 2008 at 07:46 UTC

    split / / isn't magical. You're thinking of split ' '.

    >perl -le"@a = split / /, 'abc def'; print 0+@a" 3 >perl -le"@a = split ' ', 'abc def'; print 0+@a" 2

    split ' ' is slightly better than split /\s+/, but like I said, I wouldn't use it anyway.