Re: can't run mailx as PERL system command
- From: Jenda@xxxxxxxxxxx (Jenda Krynicky)
- Date: Wed, 28 Nov 2007 13:30:12 +0100
From: Elliot Holden <eh@xxxxxxxxxxxxxxxx>
ok this is problem going to be real easy for one of you PERL gurus but
It's either Perl (the language) or perl (the interpreter), there is
no such thing as PERL.
my little brain just can't figure it out. From the command line (Solaris
9) I can do this fine:
echo my little test | mailx -s "Test Message" email@xxxxxxxxxxxx
But in PERL the below code does not work:
system("echo my little test | mailx -s \"Test Message\"
email@xxxxxxxxxxxx");
Use one of the many modules available from CPAN for sending email.
MIME::Lite, Mail::Sender, Mail::Mailer, Mail::Sendmail, ... to name
just a few. It's possible that some of them are already installed.
even if I just do:
system("mailx email@xxxxxxxxxxxx");
If you
use strict;
you get an error that will make it clear that perl though you want to
insert the contents of array @mydomain into the doublequoted string.
You have to escape $ and @ in doublequoted strings, otherwise you do
not get theliteral $ or @ but the contents of some variable. Or an
error if you use strict and the variable was not declared.
HTH, Jenda
===== Jenda@xxxxxxxxxxx === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
.
- References:
- can't run mailx as PERL system command
- From: Elliot Holden
- can't run mailx as PERL system command
- Prev by Date: Re: How to check if a function reference is valid or not?
- Next by Date: Re: How to check if a function reference is valid or not?
- Previous by thread: Re: can't run mailx as PERL system command
- Next by thread: How to check if a function reference is valid or not?
- Index(es):
Relevant Pages
|