On Tue, 27 Nov 2007 19:43:55 -0500
Elliot Holden <[EMAIL PROTECTED]> wrote:
> But in PERL the below code does not work:
>
> system("echo my little test | mailx -s \"Test Message\"
> [EMAIL PROTECTED]");
>
> even if I just do:
>
> system("mailx [EMAIL PROTECTED]");
You need to escape the '@' inside the double qoutes, otherwise it will
be interpolated as the value of '@mydomain'. From 'perltrap':
> Interpolation Traps
>
> Perl4-to-Perl5 traps having to do with how things get interpolated
> within certain expressions, statements, contexts, or whatever.
>
> * "@" always interpolates an array in double-quotish strings
> @ now always interpolates an array in double-quotish strings.
>
> print "To: [EMAIL PROTECTED]";
>
> # perl4 prints: To:[EMAIL PROTECTED]
> # perl < 5.6.1, error : In string, @somewhere now must be
> written as [EMAIL PROTECTED]
> # perl >= 5.6.1, warning : Possible unintended interpolation
> of @somewhere in string
I think I have this right, but I'm no perl guru.
Celejar
--
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/