Wow! I have a lot to blog about Perl here, so let's start. First of all, a really trivial trick that I wondered about and that avar on Freenode taught me (thanks!): how to split a string into lines while preserving the trailing "\n". It's very simple: my @a = split(/^/, $text). One thing I wonder is why I don't get an empty line at the beginning of the string, because:
perl -le 'my @a=split(/p/,"pillow pillow on the pall");print join(",",@a)'
Gives me an empty string as the first argument. I also wonder if using split(/^/, $text, -1) instead, will do any difference.
from the docs (Score:1)
Re: (Score:2)