dooberwah has asked for the wisdom of the Perl Monks concerning the following question:
That part isn't actually very interesting, because it's so simple. The more interesting (?) tidbit is this:
$line =~ /^$/ or chomp ( $line );
What is it? Well, what it does is removes the newline from the end of the line, unless the only thing on the line is a newline character. This is so normal lines are chomped, and lines that separate the stanzas aren't.
Is this the best way to do it? It runs fine ... and hey, TMTOWTDI, but is it the best (fastest, cleanest, prettiest, safest)? Comments from those wiser than I would be greatly appreciated.
-Ben Jacobs (dooberwah)
http://dooberwah.perlmonk.org
"one thing i can tell you is you got to be free"
|
|---|