Sendmail

Sendmail

am 10.04.2008 07:20:12 von Deepan Perl XML Parser

my $email = populateEmail("test");
print $email;

open(SENDMAIL, "|/usr/lib/sendmail -oi -t -i") or print "cannot open
SENDMAIL: $!";
print SENDMAIL <<"EOF";
From:
To: ${email}
Subject: [SUSTAINING TICKET] Case
Content-type: text/html
testing
EOF
close(SENDMAIL);

The above code results in "No recipient address found in header"
but when i replace ${email} with direct address say deepan.
17\@gmail.com it works fine.

populateEmail function's code is available below:

sub populateEmail {
if(lc($_[0]) eq "test") {
return ("deepan.17\@gmail.com");
}
}

Can anyone spot the bug?

Re: Sendmail

am 10.04.2008 07:30:31 von Frank Seitz

Deepan Perl XML Parser wrote:
>
> Can anyone spot the bug?

No. The code is ugly but it works.

Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel

Re: Sendmail

am 10.04.2008 07:35:11 von Deepan Perl XML Parser

On Apr 10, 10:30 am, Frank Seitz wrote:
> Deepan Perl XML Parser wrote:
>
>
>
> > Can anyone spot the bug?
>
> No. The code is ugly but it works.

which one works for you and which part of the code sounds ugly to you.
I haven't provided you the complete code but still you are able to
tell it ugly. good!

Re: Sendmail

am 10.04.2008 07:51:44 von xhoster

Deepan Perl XML Parser wrote:
> On Apr 10, 10:30 am, Frank Seitz wrote:
> > Deepan Perl XML Parser wrote:
> >
> >
> >
> > > Can anyone spot the bug?
> >
> > No. The code is ugly but it works.
>
> which one works for you

Either way worked for me. (I took the liberty of changing the email
address to point to me rather than you, however.)

> and which part of the code sounds ugly to you.

The weird indentation of the close. The bad wrapping. The use of
"\@" when '@' would due instead. The unnecessary use of
brackets in ${email}. I also found the use of non-lexical file
handles somewhat ugly. Some of it is petty stuff, but you did ask.


> I haven't provided you the complete code but still you are able to
> tell it ugly. good!

You seem to have it backwards. We don't need to see all of the code
to know it is ugly. But we maybe do need to see all of the code to debug
it, if the bug is not in the part of the code you choose to show us.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.

Re: Sendmail

am 10.04.2008 08:32:52 von Frank Seitz

Deepan Perl XML Parser wrote:
> On Apr 10, 10:30 am, Frank Seitz wrote:
>>Deepan Perl XML Parser wrote:
>>>
>>>Can anyone spot the bug?
>>
>>No. The code is ugly but it works.
>
> which one works for you and which part of the code sounds ugly to you.
> I haven't provided you the complete code but still you are able to
> tell it ugly. good!

I don't believe that you post real code and real questions.
It looks like a joke to me.

Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel