Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sendmail

3 views
Skip to first unread message

Deepan Perl XML Parser

unread,
Apr 10, 2008, 1:20:12 AM4/10/08
to
my $email = populateEmail("test");
print $email;

open(SENDMAIL, "|/usr/lib/sendmail -oi -t -i") or print "cannot open
SENDMAIL: $!";
print SENDMAIL <<"EOF";
From: <deepan\@juniper.net>
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?

Frank Seitz

unread,
Apr 10, 2008, 1:30:31 AM4/10/08
to
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

Deepan Perl XML Parser

unread,
Apr 10, 2008, 1:35:11 AM4/10/08
to
On Apr 10, 10:30 am, Frank Seitz <devnull4...@web.de> 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!

xho...@gmail.com

unread,
Apr 10, 2008, 1:51:44 AM4/10/08
to
Deepan Perl XML Parser <deep...@gmail.com> wrote:
> On Apr 10, 10:30 am, Frank Seitz <devnull4...@web.de> 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.

Frank Seitz

unread,
Apr 10, 2008, 2:32:52 AM4/10/08
to
Deepan Perl XML Parser wrote:
> On Apr 10, 10:30 am, Frank Seitz <devnull4...@web.de> 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.

0 new messages