Re: sockaddr_in() timeout or asynchone call ?



In article <x7wtegepdh.fsf@xxxxxxxxxxxxxxxx>, uri@xxxxxxxxxxxxxxx
says...
don't use most perl code you find on the net. too much of it sucks and
is for kiddies.

OK, daddy ;)

LWP (the perl web client modules) is now in the core distribution. but
that still means making sure your servers have a recent perl. if you
can't load modules (which you can as a normal user so that is not a
valid excuse) then how would you load a recent perl?

I will have to install the script on several servers, we the less upt to
date being with Perl 5.00503 under FreeBSD

>> my $sock = IO::Socket::INET->new( "$host:$port" ) ;

A> Is that the only line to change in the sub ?

no. it replaces all the crappy socket code you copied. another point is

Understood

A> print hpSOCK "GET $path HTTP/1.1\015\012";
A> print hpSOCK "Host: $host\015\012\015\012";

all that code is handled by LWP so use it instead of the crap you
copied.

Yes, but I don't want to consider the GET return (neither header nor
server response content). My subject is just to push url parameters
toward the remote cgi !

Well, someone in fr.comp.lang.perl suggest me to go through fork like
this for the purpose to do thing be no-blocking for the rest of the
script (as I wish) :

my $child = fork;
die "fork: $!\n" unless defined $child;
return if $child;

What do you mean about this way ? It's a little bit obscur for me and
don't really see how to embed a call to my sub this way...
.



Relevant Pages

  • Re: DBD::Oracle - execute_array core dumps intermittently [SOLVED]
    ... difference in the servers. ... If you have problems you may need to rebuild perl with threading enabled. ... I never compile with threads, since we have not found a need for them, yet. ... I seem to remember that on Linux I could build code asking for thread-safe and mix it with libraries which were not built this way and the linker did not complain. ...
    (perl.dbi.users)
  • Re: DBD::Oracle - execute_array core dumps intermittently [SOLVED]
    ... I am running this process on newer kernels and the error ... difference in the servers. ... If you have problems you may need to rebuild perl with threading enabled. ... get it to core dump. ...
    (perl.dbi.users)
  • Re: opening a file
    ... perldoc -f print ... I strongly suggest you get an introductory book about Perl. ... What language do sysadmins use? ... While it is true that many servers are maintained by ...
    (comp.lang.perl.misc)
  • Re: AKICIF: Multiscreen CGI program question
    ... >> You might also want to take a look into Mason, which is a Perl web ... but it doesn't really work well on shared servers; ... perhaps you could consider writing a remote XUL application. ... Guard us from the she-wolf and the wolf, and guard us from the thief, ...
    (rec.arts.sf.fandom)
  • Re: Source Code Analyzing
    ... R> http://ali.as/ "Parsing Perl" ... it isn't a true deep parser of perl5. ... load modules and pragmas which can change the syntax of following code ...
    (comp.lang.perl.misc)