weird perl script

J

jcharth

Hello I wrote a script that reads emails from a pop box, i notice that
it does not work at home, for some reason, i submit a form to the perl
script it hangs. THe process runs for a long time and no output to the
screen. But when i do the same thing from my firefox browser under
linux it works. any ideas what could cause this. THe script also runs
fine from console. I go the feeling it could be a java script in the
perl script but I doubt it.
 
A

Andy

Its hard to tell what is going wrong without knowing about your email
server configurations and seeing your code.

Some PERL modules that furnish email functionality are actually
dependant upon other existing non-PERL email mediating facilities to be
present that are O/S resident. sendmail is an example of that - its
available only on UNIX and not windows platforms. sendmail is not
itself an email server; it only formats email headers and messages
which it forwards to an SMTP server. An email PERL module (such as
MAIL::xxxx) that relies on sendmail would only pass parameters (such as
recipient email address) to sendmail which would then format these into
the commands of the email protocol used to send or receive email.

Other PERL modules implement email protocols themselves and are able to
talk to directly to any email server that conforms to those protocols
(ie SMTP or POP3 or MAPI). These modules are not platform dependant
and should work on both windows and UNIX.

Another thing to consider is whether your authentication is passing the
security layer for your POP3 server. Because you experience a "hang",
its likely the email PERL modules you are using are searching for an
email mediator that isn't on the platform you are running on. If it
was an authentication problem, you would probably receive an
unauthorized message of some kind right away.
 
A

anno4000

Andy said:
Its hard to tell what is going wrong without knowing about your email
server configurations and seeing your code.

Some PERL modules that furnish email functionality are actually

Please.

The language is Perl. The executable is often called perl, unless
it's bleadperl, perl5.8.4 or so. There is no such thing as PERL.

Anno
 
C

Charlton Wilbur

A> Some PERL modules that furnish email functionality are actually

The language is Perl; the executable is perl. It's a shibboleth, but
one that correlates very well with correct advice and attention to detail.

A> dependant upon other existing non-PERL email mediating
A> facilities to be present that are O/S resident. sendmail is an
A> example of that - its available only on UNIX and not windows
A> platforms.

Googling for "sendmail windows" shows that this is simply not correct.

Sendmail is frequently installed on Unix platforms by default, and
must be installed seaparately on Windows.

A> sendmail is not itself an email server; it only
A> formats email headers and messages which it forwards to an SMTP
A> server.

The word you are fumbling for here is mail transfer agent, or MTA.
Sendmail is, in fact, a fully-functional SMTP server.

A> An email PERL module (such as MAIL::xxxx) that relies
A> on sendmail would only pass parameters (such as recipient email
A> address) to sendmail which would then format these into the
A> commands of the email protocol used to send or receive email.

Many Perl modules, including those in the Mail:: hierarchy (note: Perl
is case-sensitive, so MAIL::Foo and Mail::Foo are different modules)
can either use the sendmail binary or an SMTP server. Exactly which
each module supports is discussed in the documentation for the module,
but a number of them support both.

A> Another thing to consider is whether your authentication is
A> passing the security layer for your POP3 server. Because you
A> experience a "hang", its likely the email PERL modules you are
A> using are searching for an email mediator that isn't on the
A> platform you are running on. If it was an authentication
A> problem, you would probably receive an unauthorized message of
A> some kind right away.

"an email mediator"?

If the script works as intended on one platform but hangs on another,
the most likely problem is a network timeout. The best solution is to
examine the data that are actually being sent, possibly with a network
sniffer; alternately, to mimic the process manually using command-line
tools, as if it's a network configuration problem (such as network
traffic not being allowed in or out on a certain port) it will show up
immediately under those circumstances.

Charlton
 
S

Scott Bryce

Michele said:
I suppose you
dynamically render a page with perl. The rendered page contains some
Javascript code.

Which could explain why the script works on some platforms and not
others. The OP should consider whether the JavaScript causing the problem.
 
J

jcharth

Thanks. I think i found the problem i am using cgi and everytime the
parameter was blank, things got messed up so i put the parameter in an
if statement before assing the value to a variable.


so one spots the problem in the first place. Incidentally, what is a
"java script in the perl script" supposed to be? I suppose you
dinamically render a page with perl. The rendered page contains some
Javascript code. Perl is not concerned with the latter any more...Incidentally (and on an OT basis) Javascript is a language that bears
very few relations to a "Java script". In fact up until a few days
before its official release it was planned to be called Livescript, it
was changed as a marketing trick to exploit Java's popularity at that
time. But they are otherwise mostly unrelated languages.

Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,662
Latest member
sxarexu

Latest Threads

Top