[28653] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 10017 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 29 00:05:49 2006

Date: Tue, 28 Nov 2006 21:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 28 Nov 2006     Volume: 10 Number: 10017

Today's topics:
    Re: Bareword errors? <reviewyourdemo@hotmail.com>
    Re: Bareword errors? <tadmc@augustmail.com>
    Re: Bareword errors? <spamtrap@dot-app.org>
        CGI parsing (was: Bareword errors?) <noreply@gunnar.cc>
    Re: CGI parsing (was: Bareword errors?) <tadmc@augustmail.com>
    Re: CGI parsing (was: Bareword errors?) <benmorrow@tiscali.co.uk>
    Re: CGI parsing (was: Bareword errors?) <spamtrap@dot-app.org>
    Re: CGI parsing <noreply@gunnar.cc>
    Re: Date function <tbmoore9@verizon.net>
    Re: Date function <noreply@gunnar.cc>
        line breaks <reviewyourdemo@hotmail.com>
    Re: Perl/Mail Suggestion.... <amerar@iwc.net>
    Re: Perl/Mail Suggestion.... <amerar@iwc.net>
    Re: Perl/Mail Suggestion.... <antispam@randometry.com>
    Re: Perl/Mail Suggestion.... <amerar@iwc.net>
    Re: Perl/Mail Suggestion.... <amerar@iwc.net>
    Re: regex matching exactly 10 digits <tadmc@augustmail.com>
        relax <reviewyourdemo@hotmail.com>
        rewrite <reviewyourdemo@hotmail.com>
        Take out email attachment and HTML tag <>
    Re: Validation with XSD using XML::LibXML::Schema, and  skye.shaw@gmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 28 Nov 2006 19:23:19 -0500
From: gcr <reviewyourdemo@hotmail.com>
Subject: Re: Bareword errors?
Message-Id: <reviewyourdemo-92D7C9.19231928112006@reader2.panix.com>

In article <m21wnnmcs4.fsf@Sherm-Pendleys-Computer.local>,
 Sherm Pendley <spamtrap@dot-app.org> wrote:

> gcr <reviewyourdemo@hotmail.com> writes:
> 
> > Side point - I've been burned a few times by cgi.pm so I gave up on it
> 
> If you get "burned" by something that literally *thousands* of other people
> are using successfully, giving up and blaming the module is just silly.

Line breaks - cgi.pm was inconsistent. This is a while back, may have 
been fixed by now or maybe I didn't get it back then. There were also 
big back and forths on the newsgroup by those more knowledgable than I 
(that would be everyone) about the pluses and minuses of cgi.pm. I 
haven't been burned *yet* by using the regexes and it's been in pretty 
constant use for a while. I like to be able to control what is being 
decoded for various reasons which I wasn't able to figure out in cgi.pm. 
I've also fixed other peoples broken cgi's (again, linebreak issues) by 
taking cgi.pm out and using regexes. YMMV.


> So? It's still awful code, regardless of how long you've been using it. It
> uses global variables, for pity's sake.

I added strict when posting to the NG and defined the variables on the 
fly at the head for the example. The main HASH{} could be named WEB{} I 
guess but I'm the only maintainer so it hasn't bothered me.

> You're claiming that the standard
> module is somehow inferior,

Not at all. *I* couldn't make it work, fault probably lies here. The 
other code worked and hasn't broken yet. I moved on.

> when the author of the code you're using now
> doesn't even know how to return a value from a subroutine?
>

Unclear what you mean - again purely my ignorance. Like I said, this 
code has run in various places for a while with no problems (besides 
sheer idiocy like my parent posting which wasn't the code but PEBKAC)

Thanks for getting, anyways.


------------------------------

Date: Tue, 28 Nov 2006 19:49:58 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Bareword errors?
Message-Id: <slrnemppq6.1n7.tadmc@tadmc30.august.net>

gcr <reviewyourdemo@hotmail.com> wrote:
> In article <m21wnnmcs4.fsf@Sherm-Pendleys-Computer.local>,
>  Sherm Pendley <spamtrap@dot-app.org> wrote:
>
>> gcr <reviewyourdemo@hotmail.com> writes:
>> 
>> > Side point - I've been burned a few times by cgi.pm so I gave up on it
>> 
>> If you get "burned" by something that literally *thousands* of other people
>> are using successfully, giving up and blaming the module is just silly.
>
> Line breaks - cgi.pm was inconsistent.


Line breaks don't generally matter in the output of a CGI program (HTML).


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 28 Nov 2006 22:14:12 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Bareword errors?
Message-Id: <m24psjj663.fsf@Sherm-Pendleys-Computer.local>

gcr <reviewyourdemo@hotmail.com> writes:

> Line breaks - cgi.pm was inconsistent. This is a while back, may have 
> been fixed by now or maybe I didn't get it back then.

You didn't get it. There's nothing in the relevant standards the requires
line breaks to be consistent.

> There were also 
> big back and forths on the newsgroup by those more knowledgable than I 
> (that would be everyone) about the pluses and minuses of cgi.pm.

I highly doubt that. You're using homemade code instead of CGI.pm (spelling
matters) to parse input from a form. That particular use of CGI.pm hasn't
been the subject of any serious debate, at least among people who know what
they're talking about.

There *has* been some debate about the inclusion in CGI.pm of HTML-generating
functions. But those aren't what we're discussing here, and that train left
the station a long time ago anyway.

And, of course, there have been many discussions like this one, between
people who actually know what they're doing and others who seem to take
some kind of strange pride in writing bad code.

> I've also fixed other peoples broken cgi's (again, linebreak issues) by 
> taking cgi.pm out and using regexes. YMMV.

Let me get this straight - you don't know what a global is, you don't know
what it means to return a value from a subroutine, and you *still* think
you're in a position to judge whether CGI.pm is worth using? You actually
believe you're qualified to not only call code that uses CGI.pm "broken",
but also that you're qualified to "fix" it????

Unbelieveable.

> Unclear what you mean - again purely my ignorance. Like I said, this 
> code has run in various places for a while with no problems

You can repeat that as many times as you like - it won't change the fact
that rolling your own CGI parsing code is foolish, *especially* given the
low level of knowledge you've shown here concerning not only the CGI spec,
but programming in general.

Anyway, since you're apparently more interested in defending your ignorance
than curing it, I'm done with this.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: Wed, 29 Nov 2006 03:13:37 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: CGI parsing (was: Bareword errors?)
Message-Id: <4t48mjF12akkjU1@mid.individual.net>

Sherm Pendley wrote:
> gcr writes:
>>I didn't reinvent this wheel, though, I got it from someone and have 
>>been using it for a while.
> 
> So? It's still awful code, regardless of how long you've been using it. It
> uses global variables, for pity's sake. You're claiming that the standard
> module is somehow inferior,

As you well know, it _is_ inferior in one way: efficiency. Personally I 
often use it because it's convenient, but in situations when efficiency 
matters I don't. I have never understood why some regulars here get so 
upset as soon as they see a piece of trivial CGI parsing code.

> when the author of the code you're using now
> doesn't even know how to return a value from a subroutine?

So, let's improve it a little:

     my %HASH = getcgi();

     sub getcgi {
         my ($buffer, %params);
         if ( $ENV{REQUEST_METHOD} eq 'POST' ) {
             my $len = $ENV{CONTENT_LENGTH};
             $len <= 131072 or die "Too much data submitted.\n";
             binmode STDIN;
             read( STDIN, $buffer, $len ) == $len
              or die "Reading of posted data failed.\n";
         } else {
             $buffer = $ENV{QUERY_STRING};
         }
         $buffer =~ tr/+/ /;
         for ( split /[&;]/, $buffer )	{
             my ($name, $value) =
              map { s/%(..)/chr(hex $1)/eg; $_ } split /=/, $_, 2;
             $params{$name} = $value;
         }
         wantarray ? %params : \%params;
     }

As regards the line

     $value =~ s/<!--(.|\n)*-->//g;

in the OP's code, it's probably there to take care of <!--exec ... --> 
constructs. Personally I always let user input pass this (or some 
similar) function:

     sub entify {
         my $ref = defined wantarray ? [ @_ ] : \@_;
         my %ent = ('&'=>'amp', '"'=>'quot', '<'=>'lt', '>'=>'gt');
         s/([&"<>])/&$ent{$1};/g for grep defined, @$ref;
         if ( defined wantarray ) {
             @$ref > 1 ? @$ref : $$ref[0];
         }
     }

before it's presented in an HTML context. That takes care also of the 
<!--exec ... --> issue.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Tue, 28 Nov 2006 21:25:46 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: CGI parsing (was: Bareword errors?)
Message-Id: <slrnempvdq.2io.tadmc@tadmc30.august.net>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:

> . I have never understood why some regulars here get so 
> upset as soon as they see a piece of trivial CGI parsing code.


Then you probably were not here when 20% of all posts here got
it "trivially" wrong (mid '90's).

Since it is not in your experience, you will never understand,
so can you quit harping on it?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Wed, 29 Nov 2006 03:42:12 +0000
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: CGI parsing (was: Bareword errors?)
Message-Id: <k5cv34-dto.ln1@osiris.mauzo.dyndns.org>


Quoth Gunnar Hjalmarsson <noreply@gunnar.cc>:
> Sherm Pendley wrote:
> > gcr writes:
> >>I didn't reinvent this wheel, though, I got it from someone and have 
> >>been using it for a while.
> > 
> > So? It's still awful code, regardless of how long you've been using it. It
> > uses global variables, for pity's sake. You're claiming that the standard
> > module is somehow inferior,
> 
> As you well know, it _is_ inferior in one way: efficiency. Personally I 
> often use it because it's convenient, but in situations when efficiency 
> matters I don't. I have never understood why some regulars here get so 
> upset as soon as they see a piece of trivial CGI parsing code.

Because parsing CGI isn't as trivial as people think, and rewriting
rather than reusing even a fairly simple piece of code is a very bad
programming practice. If you can do it *correctly* more efficiently than
CGI.pm can, then by all means please release your code as
CGI::VeryEfficient or something, and then the rest of us can get the
benefit as well.

Personally, for the tiny amount of CGI stuff I've done I used CGI::Lite,
simply because the size of CGI.pm's perldoc daunted me somewhat; but
rewriting it for every CGI script is just daft.

Ben

-- 
  Joy and Woe are woven fine,
  A Clothing for the Soul divine       William Blake
  Under every grief and pine          'Auguries of Innocence'
  Runs a joy with silken twine.                         benmorrow@tiscali.co.uk


------------------------------

Date: Tue, 28 Nov 2006 23:06:32 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: CGI parsing (was: Bareword errors?)
Message-Id: <m2zmaaj3qv.fsf@Sherm-Pendleys-Computer.local>

Gunnar Hjalmarsson <noreply@gunnar.cc> writes:

> As you well know, it _is_ inferior in one way: efficiency. Personally
> I often use it because it's convenient, but in situations when
> efficiency matters I don't.

In situations where efficiency matters, I'll take mod_perl any day. :-)

But seriously - the OP doesn't know what a global is. He doesn't know what
"return a value from a subroutine" means. Do you really think he profiled
his app and found CGI.pm to be a significant bottleneck?

I don't find it upsetting when a skilled developer has a good reason (such
as a profiler-verified bottleneck) for choosing not to use CGI.pm.

I find it quite upsetting when a newbie refuses to use it, and then argues
about it and invents specious excuses for what basically amounts to simple
contrariness.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: Wed, 29 Nov 2006 04:57:08 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: CGI parsing
Message-Id: <4t4eolF120fcgU1@mid.individual.net>

Tad McClellan wrote:
> Gunnar Hjalmarsson wrote:
>>. I have never understood why some regulars here get so 
>>upset as soon as they see a piece of trivial CGI parsing code.
> 
> Then you probably were not here when 20% of all posts here got
> it "trivially" wrong (mid '90's).

Right, I wasn't.

Mid 90's. Ten years. Maybe it's time to relax? :)

> Since it is not in your experience, you will never understand,

Probably not. Which is true also for other relative newcomers who are 
picked on. While the tone occationally used, when commenting on this 
matter here, serves no useful purpose, I'm convinced it unnecessarily 
scares away a few.

> so can you quit harping on it?

I will, when the tone gets more sober.

But hey, things have improved. A couple of years ago, when someone 
revealed that they were using their own code for parsing CGI, about 10 
regulars told that person that s/he was stupid. Nowadays only one or two 
regulars do the same thing. ;-)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Tue, 28 Nov 2006 23:07:53 GMT
From: boyd <tbmoore9@verizon.net>
Subject: Re: Date function
Message-Id: <tbmoore9-49794F.18075428112006@news.verizon.net>

In article <4t3t5hF126g8tU1@mid.individual.net>,
 Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:

> boyd wrote:
> > In article <4t3qsqF11g6o6U2@mid.individual.net>,
> >  Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
> >>boyd wrote:
> >>>something like:
> >>>
> >>>my( $day, $mon, $yr ) = ( localtime( time - 24*3600) )[3, 4, 5];
> >>>$yr += 1900;
> >>>$mon += 1;
> >>>my $str = sprintf '%4d-%02d-%02d', $yr, $mon, $day;
> >>>
> >>>would give you the prefix string for your filename.
> >>
> >>What about DST? ;-)
> > 
> > Good point.  So my method would mess up on one of the DST changeovers if 
> > it ran between midnight and 0100 local.  Is that right?
> 
> Yeah, that's what I'm thinking of. Maybe not a disaster in this case, 
> but always worth considering when dealing with dates.
> 
> > What is the "40000" for in your script?
> 
> That's 'approximately' 12 hours, i.e. well enough time to make the 
> result DST safe. :)

Thanks.  I have another question.  I administer a Sun network and one 
Linux box at work, both of which are isolated from the world ( I have to 
hand carry in patches, etc. )  So the upcoming DST rule change may be a 
problem.  I'm sure you are aware that next March, DST starts on, IIRC, 
Mar. 11, and ends the first weekend in November.  What's the best way to 
deal with the changes? (at home I have Ubuntu and Mac OS X )

Boyd


------------------------------

Date: Wed, 29 Nov 2006 00:51:48 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Date function
Message-Id: <4t40cmF126p7oU1@mid.individual.net>

boyd wrote:
> I administer a Sun network and one 
> Linux box at work, both of which are isolated from the world ( I have to 
> hand carry in patches, etc. )  So the upcoming DST rule change may be a 
> problem.  I'm sure you are aware that next March, DST starts on, IIRC, 
> Mar. 11, and ends the first weekend in November.  What's the best way to 
> deal with the changes? (at home I have Ubuntu and Mac OS X )

I'm anything but a DST expert, but don't all OS distros come with 
current info about switches to/from DST worldwide? I didn't know about 
the change you are referring to, maybe because I live in Sweden and 
those dates vary between countries, but if there was a late decision in 
your country, isn't there simply a patch for each OS available?

Hopefully somebody is able to give you a more authoritative comment. :)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 29 Nov 2006 00:09:19 -0500
From: gcr <reviewyourdemo@hotmail.com>
Subject: line breaks
Message-Id: <reviewyourdemo-63EF16.00091929112006@reader2.panix.com>

> Line breaks don't generally matter in the output of a CGI program (HTML).

My bad. I was not writing or reading from html. CGI.pm *seemed to be* 
encoding linebreaks in such a way that the downstream application broke. 
I will happily agree that it was my incompatence in using it ... 
however, by replacing with the bad code the script worked, the app 
worked, and is working still.

Sure didn't want to start off a flamewar when my original problem was 
purely idiocy and crossed eyes. Guess I'll stay off this NG


------------------------------

Date: 28 Nov 2006 16:37:48 -0800
From: "amerar@iwc.net" <amerar@iwc.net>
Subject: Re: Perl/Mail Suggestion....
Message-Id: <1164760668.724870.58870@14g2000cws.googlegroups.com>


Sharif Islam wrote:
> amerar@iwc.net wrote:
> > Hi all,
> >
> > I've just built myself a new server and installed Linux.  I currently
> > have a mailserver rnning Red Hat 9.0 and I'm using Postifx.
> >
> > My existing server runs just fine.  I want to bring my new server
> > online to test the mail portion without taking down my current server.
> >
> > I have set up Squirrelmail and that seems to deliver mail just fine.
> > However, when I try and run a Perl script which uses the Net::SMTP
> > module, I receive this error:
> >
> > "Can't call method "mail" on an undefined value at
> > /prod/scripts/send.pl line 208."
> >
> > Here is a clip of my code:
> >
> >          $smtp = Net::SMTP->new("nytelife");
> >          $smtp->mail("mail.chicagorsvp.com");
> >          $smtp->to($email);
> >          $smtp->data();
>
> can you make sure you are able to connect to the smtp server?
> Try this:
>
> $smtp = Net::SMTP->new("nytelife"); # connect to an SMTP server
> if (defined $smtp)
> {
>
> $smtp->mail("mail.chicagorsvp.com");
> $smtp->to($email);
> $smtp->data();
> }
> else {
> print "Cannot to connect to nytelife";
> exit;
> }
>
> --sharif

Hmm....says it cannot connect, even though Postfix IS running and I can
send email internally.......

Any thoughts?

I've shutdown postfix on my other server, and I've changed my
forwarding on my router to forward posts 25 & 113 to the new
machine........



------------------------------

Date: 28 Nov 2006 16:41:34 -0800
From: "amerar@iwc.net" <amerar@iwc.net>
Subject: Re: Perl/Mail Suggestion....
Message-Id: <1164760894.074726.70290@14g2000cws.googlegroups.com>


Sharif Islam wrote:
> amerar@iwc.net wrote:
> > Hi all,
> >
> > I've just built myself a new server and installed Linux.  I currently
> > have a mailserver rnning Red Hat 9.0 and I'm using Postifx.
> >
> > My existing server runs just fine.  I want to bring my new server
> > online to test the mail portion without taking down my current server.
> >
> > I have set up Squirrelmail and that seems to deliver mail just fine.
> > However, when I try and run a Perl script which uses the Net::SMTP
> > module, I receive this error:
> >
> > "Can't call method "mail" on an undefined value at
> > /prod/scripts/send.pl line 208."
> >
> > Here is a clip of my code:
> >
> >          $smtp = Net::SMTP->new("nytelife");
> >          $smtp->mail("mail.chicagorsvp.com");
> >          $smtp->to($email);
> >          $smtp->data();
>
> can you make sure you are able to connect to the smtp server?
> Try this:
>
> $smtp = Net::SMTP->new("nytelife"); # connect to an SMTP server
> if (defined $smtp)
> {
>
> $smtp->mail("mail.chicagorsvp.com");
> $smtp->to($email);
> $smtp->data();
> }
> else {
> print "Cannot to connect to nytelife";
> exit;
> }
> 
> --sharif

I meant to say ports 25 & 110.......



------------------------------

Date: Wed, 29 Nov 2006 02:20:49 +0100
From: Ric <antispam@randometry.com>
Subject: Re: Perl/Mail Suggestion....
Message-Id: <ekincl$jc2$1@online.de>

amerar@iwc.net schrieb:
> Sharif Islam wrote:
>> amerar@iwc.net wrote:
>>> Hi all,
>>>
>>> I've just built myself a new server and installed Linux.  I currently
>>> have a mailserver rnning Red Hat 9.0 and I'm using Postifx.
>>>
>>> My existing server runs just fine.  I want to bring my new server
>>> online to test the mail portion without taking down my current server.
>>>
>>> I have set up Squirrelmail and that seems to deliver mail just fine.
>>> However, when I try and run a Perl script which uses the Net::SMTP
>>> module, I receive this error:
>>>
>>> "Can't call method "mail" on an undefined value at
>>> /prod/scripts/send.pl line 208."
>>>
>>> Here is a clip of my code:
>>>
>>>          $smtp = Net::SMTP->new("nytelife");
>>>          $smtp->mail("mail.chicagorsvp.com");
>>>          $smtp->to($email);
>>>          $smtp->data();
>> can you make sure you are able to connect to the smtp server?
>> Try this:
>>
>> $smtp = Net::SMTP->new("nytelife"); # connect to an SMTP server
>> if (defined $smtp)
>> {
>>
>> $smtp->mail("mail.chicagorsvp.com");
>> $smtp->to($email);
>> $smtp->data();
>> }
>> else {
>> print "Cannot to connect to nytelife";
>> exit;
>> }
>>
>> --sharif
> 
> Hmm....says it cannot connect, even though Postfix IS running and I can
> send email internally.......
> 
> Any thoughts?
> 
> I've shutdown postfix on my other server, and I've changed my
> forwarding on my router to forward posts 25 & 113 to the new
110 is only for pop and postfix does no pop:-)
> machine........
> 

so your mailservers hostname is: mail.chicagorsvp.com ?

If it is you should be able to telnet to it:

telnet mail.chicagorsvp.com 25

You should see the postfix response message. Now you can type:

EHLO chicagorsvp.com

You should see response ok. Type:

MAIL FROM: youremailadress

You should see ok. Type

RCPT TO: emailadress

You should see ok. Type

DATA

Mailserver responds: enter mail. Type your mail

dfssadfa

then newline . exit

depending ony what kind of mailadresses you used and how you configured
the mailserver may reject your message. If you don't even see the
initial postfix responce, then try with the ip of your machine.




------------------------------

Date: 28 Nov 2006 17:29:46 -0800
From: "amerar@iwc.net" <amerar@iwc.net>
Subject: Re: Perl/Mail Suggestion....
Message-Id: <1164763786.107105.222160@14g2000cws.googlegroups.com>


Ric wrote:
> amerar@iwc.net schrieb:
> > Sharif Islam wrote:
> >> amerar@iwc.net wrote:
> >>> Hi all,
> >>>
> >>> I've just built myself a new server and installed Linux.  I currently
> >>> have a mailserver rnning Red Hat 9.0 and I'm using Postifx.
> >>>
> >>> My existing server runs just fine.  I want to bring my new server
> >>> online to test the mail portion without taking down my current server.
> >>>
> >>> I have set up Squirrelmail and that seems to deliver mail just fine.
> >>> However, when I try and run a Perl script which uses the Net::SMTP
> >>> module, I receive this error:
> >>>
> >>> "Can't call method "mail" on an undefined value at
> >>> /prod/scripts/send.pl line 208."
> >>>
> >>> Here is a clip of my code:
> >>>
> >>>          $smtp = Net::SMTP->new("nytelife");
> >>>          $smtp->mail("mail.chicagorsvp.com");
> >>>          $smtp->to($email);
> >>>          $smtp->data();
> >> can you make sure you are able to connect to the smtp server?
> >> Try this:
> >>
> >> $smtp = Net::SMTP->new("nytelife"); # connect to an SMTP server
> >> if (defined $smtp)
> >> {
> >>
> >> $smtp->mail("mail.chicagorsvp.com");
> >> $smtp->to($email);
> >> $smtp->data();
> >> }
> >> else {
> >> print "Cannot to connect to nytelife";
> >> exit;
> >> }
> >>
> >> --sharif
> >
> > Hmm....says it cannot connect, even though Postfix IS running and I can
> > send email internally.......
> >
> > Any thoughts?
> >
> > I've shutdown postfix on my other server, and I've changed my
> > forwarding on my router to forward posts 25 & 113 to the new
> 110 is only for pop and postfix does no pop:-)
> > machine........
> >
>
> so your mailservers hostname is: mail.chicagorsvp.com ?
>
> If it is you should be able to telnet to it:
>
> telnet mail.chicagorsvp.com 25
>
> You should see the postfix response message. Now you can type:
>
> EHLO chicagorsvp.com
>
> You should see response ok. Type:
>
> MAIL FROM: youremailadress
>
> You should see ok. Type
>
> RCPT TO: emailadress
>
> You should see ok. Type
>
> DATA
>
> Mailserver responds: enter mail. Type your mail
>
> dfssadfa
>
> then newline . exit
>
> depending ony what kind of mailadresses you used and how you configured
> the mailserver may reject your message. If you don't even see the
> initial postfix responce, then try with the ip of your machine.

Hmm...tried your suggestion, here is the output:

[root@nytelife scripts]# telnet mail.chicagorsvp.com 25
Trying 206.126.253.242...
telnet: connect to address 206.126.253.242: Connection refused

And, I have IPTABLES running, but I've enabled ports 110 & 25:

ACCEPT     tcp  --  anywhere             anywhere            state NEW
tcp dpt:smtp
ACCEPT     tcp  --  anywhere             anywhere            state NEW
tcp dpt:pop3

Any suggestions?  This is weird as I copied config files from a working
server.....



------------------------------

Date: 28 Nov 2006 17:40:05 -0800
From: "amerar@iwc.net" <amerar@iwc.net>
Subject: Re: Perl/Mail Suggestion....
Message-Id: <1164764405.817426.255510@14g2000cws.googlegroups.com>


Ric wrote:
> amerar@iwc.net schrieb:
> > Sharif Islam wrote:
> >> amerar@iwc.net wrote:
> >>> Hi all,
> >>>
> >>> I've just built myself a new server and installed Linux.  I currently
> >>> have a mailserver rnning Red Hat 9.0 and I'm using Postifx.
> >>>
> >>> My existing server runs just fine.  I want to bring my new server
> >>> online to test the mail portion without taking down my current server.
> >>>
> >>> I have set up Squirrelmail and that seems to deliver mail just fine.
> >>> However, when I try and run a Perl script which uses the Net::SMTP
> >>> module, I receive this error:
> >>>
> >>> "Can't call method "mail" on an undefined value at
> >>> /prod/scripts/send.pl line 208."
> >>>
> >>> Here is a clip of my code:
> >>>
> >>>          $smtp = Net::SMTP->new("nytelife");
> >>>          $smtp->mail("mail.chicagorsvp.com");
> >>>          $smtp->to($email);
> >>>          $smtp->data();
> >> can you make sure you are able to connect to the smtp server?
> >> Try this:
> >>
> >> $smtp = Net::SMTP->new("nytelife"); # connect to an SMTP server
> >> if (defined $smtp)
> >> {
> >>
> >> $smtp->mail("mail.chicagorsvp.com");
> >> $smtp->to($email);
> >> $smtp->data();
> >> }
> >> else {
> >> print "Cannot to connect to nytelife";
> >> exit;
> >> }
> >>
> >> --sharif
> >
> > Hmm....says it cannot connect, even though Postfix IS running and I can
> > send email internally.......
> >
> > Any thoughts?
> >
> > I've shutdown postfix on my other server, and I've changed my
> > forwarding on my router to forward posts 25 & 113 to the new
> 110 is only for pop and postfix does no pop:-)
> > machine........
> >
>
> so your mailservers hostname is: mail.chicagorsvp.com ?
>
> If it is you should be able to telnet to it:
>
> telnet mail.chicagorsvp.com 25
>
> You should see the postfix response message. Now you can type:
>
> EHLO chicagorsvp.com
>
> You should see response ok. Type:
>
> MAIL FROM: youremailadress
>
> You should see ok. Type
>
> RCPT TO: emailadress
>
> You should see ok. Type
>
> DATA
>
> Mailserver responds: enter mail. Type your mail
>
> dfssadfa
>
> then newline . exit
>
> depending ony what kind of mailadresses you used and how you configured
> the mailserver may reject your message. If you don't even see the
> initial postfix responce, then try with the ip of your machine.

Also, I ran netstat.   I'm not sure if this is correct or not, so maybe
someone can look and tell me of the Port 25 entry is correct?


[root@nytelife scripts]# netstat -atn |grep LISTEN
tcp        0      0 0.0.0.0:3306                0.0.0.0:*
    LISTEN
tcp        0      0 0.0.0.0:907                 0.0.0.0:*
    LISTEN
tcp        0      0 127.0.0.1:783               0.0.0.0:*
    LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*
    LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*
    LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*
    LISTEN
tcp        0      0 :::993                      :::*
    LISTEN
tcp        0      0 :::995                      :::*
    LISTEN
tcp        0      0 :::110                      :::*
    LISTEN
tcp        0      0 :::143                      :::*
    LISTEN
tcp        0      0 :::80                       :::*
    LISTEN
tcp        0      0 :::443                      :::*
    LISTEN



------------------------------

Date: Tue, 28 Nov 2006 19:30:17 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: regex matching exactly 10 digits
Message-Id: <slrnempol9.1n7.tadmc@tadmc30.august.net>

Mr P <MisterPerl@gmail.com> wrote:

> perhaps
>
>    s|^\d{10}$|1$1|;


What do you expect to be in $1 there on the "RHS"?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 28 Nov 2006 23:59:57 -0500
From: gcr <reviewyourdemo@hotmail.com>
Subject: relax
Message-Id: <reviewyourdemo-E456C4.23595728112006@reader2.panix.com>

> Let me get this straight - you don't know what a global is, you don't know
> what it means to return a value from a subroutine,

Uh I've been very good at staying out of flamewars over the years so I 
won't respond except to say incorrect  - I do know what global is and 
I've written my own subroutines in Perl and C. Some of them have been 
running on the interweb bug free for a while now.

> call code that uses CGI.pm "broken"

No. You're reading what you want to read. By taking cgi.pm out of 
someone elses code and replacing it with my incompetance the code worked.
His problem was solved.

I also never claimed I was qualified to judge cgi.pm or anything else on 
this newsgroup. I pointed out what worked for me.

> since you're apparently more interested in defending your ignorance
> than curing it, I'm done with this.

No worries. See one of the parent responses with some cool, IMHO, code.


------------------------------

Date: Tue, 28 Nov 2006 23:48:09 -0500
From: gcr <reviewyourdemo@hotmail.com>
Subject: rewrite
Message-Id: <reviewyourdemo-B4857A.23480928112006@reader2.panix.com>

Hey this is cool! Expecially
 map { s/%(..)/chr(hex $1)/eg; $_ } split /=/, $_, 2;

Thanks!


------------------------------

Date: Wed, 29 Nov 2006 10:51:49 +0800
From: hmchkus <>
Subject: Take out email attachment and HTML tag
Message-Id: <actpm2d260dkvh1k2plgbm2f0og2pvbtda@4ax.com>

Hi,

Could you let me know if there's a perl module that can take out email
attachment and HTML tag? Thanks!!


------------------------------

Date: 28 Nov 2006 15:57:47 -0800
From: skye.shaw@gmail.com
Subject: Re: Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema
Message-Id: <1164758267.683604.309690@l39g2000cwd.googlegroups.com>


> I suspect  XML::LibXML::Schema may be getting confused by the explicit
> empty namepace declaration.
>
> <xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="package">

Yup that was it. 

Thank you very much!



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 10017
****************************************


home help back first fref pref prev next nref lref last post