Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Send e-mail using perl

by Jenda (Abbot)
on Aug 07, 2012 at 08:19 UTC ( #985911=note: print w/ replies, xml ) Need Help??


in reply to Send e-mail using perl

Considering the number of mail related modules on CPAN it surprises me that someone still attempts to shell out and use an external executable. Without testing whether the executable exists, whether it was started successfully, whether it reported any errors ...

Unrelated note: drop the &. It's not necessary in this case and means something else than people tend to think in other cases.

Jenda
Enoch was right!
Enjoy the last years of Rome.


Comment on Re: Send e-mail using perl
Replies are listed 'Best First'.
Re^2: Send e-mail using perl
by flexvault (Prior) on Aug 07, 2012 at 14:18 UTC

    Jenda,

      Unrelated note: drop the &. It's not necessary in this case and means something else than people tend to think in other cases.

    Could you explain this or give a reference. I see this comment a lot, and have never experienced any side-effect of using the '&'. I use the '&' to visually distinguish between in-script 'sub's and 'sub's that I have no control over via use/require/Begin.

    When you haven't looked at code in 2-5 years and now need to modify it, small visual aids do help!

    Thank you

    "Well done is better than well said." - Benjamin Franklin

      It's the old Perl4-style sub call syntax, and means "ignore prototype" and (if no arguments are passed), "make current @_ visible to subroutine" (perlsub)

      Its use is discouraged but it doesn't seem to be harmful. Personally, I just view it as ugly and a hint that "this user learned Perl from tutorials written in 1995"

        The prototypes are fine, it's the "current @_" that I meant. There's a big and likely hard to debug difference between &foo(); and &foo;.

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

        AM,

        And if the user started using Perl in 1996, then I would expect that to be true!

        "Well done is better than well said." - Benjamin Franklin

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (14)
As of 2015-07-30 23:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls