http://qs321.pair.com?node_id=388669


in reply to Re^2: Annoying whitespace(s)...
in thread Annoying whitespace(s)...

Corion's analysis was bang-on (yes, this really is horrible code.) One more suggestion - take this script, and rewrite it using Template Toolkit to generate the content and MIME::Lite to manage the email. You'd probably cut the script to a third the length it is now, and you'd be amazed how much more readable and maintainable it would be.

Just my $0.02,


_______________
DamnDirtyApe
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
            --Friedrich Nietzsche

Replies are listed 'Best First'.
Re^4: Annoying whitespace(s)...
by reaction (Acolyte) on Sep 05, 2004 at 22:33 UTC
    Thanks, I wanted to try to keep this simple...

    R

      I don't know anything myself about templating - another one of those programming tools I'll have to learn at some point - but I took a quick look at MIME::Lite just now, and it will make your script simpler, not more complicated.

      mybox# perl -eshell -MCPAN cpan> install MIME::Lite ...buncha installation messages... cpan> exit mybox# exit mybox> perldoc MIME::Lite

      Very cool stuff, and pretty easy to use. With Perl, if you can find a module on CPAN that does something for you, it's often best to install and learn that module, rather than code it yourself. Since you appear to have a C background, think of modules as installing a bunch of .h files with some easy-to-use functions.

      --J