in reply to page break at paragraph break

Nice! Heh, CHOMP... what would we do without fun keywords? I'm rather fond of carp, croak, cluck, and confess.

As for the script itself, cool use for Perl. It looks just fine. I don't know if you're looking for suggestions, but a couple things popped into my head as I was reading. You could pass @chunk and $line into printchunk, returning the new line number. That way, if the program becomes larger it won't be cluttered up with globals. Also, LPP is a seldom-used constant. It could have a more expressive name without too much extra typing.

That's all! Welcome to PerlMonks.

~dewey

Replies are listed 'Best First'.
Re^2: page break at paragraph break
by dbw (Beadle) on Jul 29, 2007 at 02:41 UTC
    Thanks dewey! :)

    Not only does the constant have a mysterious name, it should probably be a variable settable by a command line option... but whatever :P

    And as far as passing arguments to printchunk... I agree again. It was done this way because I didn't originally have the second call, but then I realized I was cutting off the last few bars of every song. o.O So I jammed it in a sub and added a second call---which is more elegant than copy-pasting it, though not as elegant as what you suggest.