Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^3: Annoying whitespace(s)...

by DamnDirtyApe (Curate)
on Sep 05, 2004 at 22:19 UTC ( #388669=note: print w/replies, xml ) Need Help??

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,

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...


      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.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://388669]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2021-10-21 04:08 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (82 votes). Check out past polls.