[23289] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5509 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 16 06:08:32 2003

Date: Tue, 16 Sep 2003 03:05:10 -0700 (PDT)
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, 16 Sep 2003     Volume: 10 Number: 5509

Today's topics:
    Re: "between" function equivalent in Perl? (Tad McClellan)
        boston perl classes with damian conway <uri@stemsystems.com>
    Re: boston perl classes with damian conway <abigail@abigail.nl>
    Re: boston perl classes with damian conway <tassilo.parseval@rwth-aachen.de>
    Re: boston perl classes with damian conway <abigail@abigail.nl>
    Re: Crypt::SSLeay (Helgi Briem)
        date sorting module <samj@austarmetro.com.au>
    Re: date sorting module <ak+usenet@freeshell.org>
    Re: HoH and MLDBM problems <tom@nosleep.net>
    Re: javascript=escape() perl=(looking for equiv) (Tad McClellan)
    Re: javascript=escape() perl=(looking for equiv) <mbudash@sonic.net>
    Re: need DBD::ODBC help <ThomasKratz@REMOVEwebCAPS.de>
    Re: need DBD::ODBC help <thaynes@openlinksw.com>
        Pausing a script <ducott@hotmail.com>
    Re: Pausing a script (Jay Tilton)
    Re: Pausing a script <ducott@hotmail.com>
    Re: Pausing a script <mbudash@sonic.net>
    Re: Pausing a script <mbudash@sonic.net>
    Re: Pausing a script <kuujinbo@hotmail.com>
    Re: Pb with IO::Socket::INET and recv <sppNOSPAM@monaco377.com>
    Re: Perl way to do PHP includes? (Tad McClellan)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 16 Sep 2003 01:03:39 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: "between" function equivalent in Perl?
Message-Id: <slrnbmd9tr.2ip.tadmc@magna.augustmail.com>

Alexandra <sagittaur@ftml.net> wrote:

> $mystring = ('xxx server1=user1 @', 'yyy server1=user2 @', 'zzz
> server2=user1 @');


I think I've already suggested that you try print()ing the
value of $mystring at this point in your code.

Have you tried that yet?


> Can't locate warnings.pm in @INC (@INC contains:
> /usr/lib/perl5/5.00502/sun4-solaris /usr/lib/perl5/5.00502
> /usr/lib/perl5/site_perl/5.005/sun4-solaris /usr/lib/perl5/site_perl/5.005
> .) at test.pl line 3.
> BEGIN failed--compilation aborted at test.pl line 3.


   use warnings;

only works with perls that are less than three and a half years old (v5.6.0).

So you can only use the inferior -w command line switch with
your perl of antiquity.


> Global symbol "$mystring" requires explicit package name at test.pl line 6.


   use strict;

("perldoc strict" to read the docs for the pragma)

requires that you declare all of your variables: 

   my $mystring = ...

or that you use an explicit package name:

   $main::mystring = ...


> A posting guideline question:
> This thread originated with my question about a between function equivalent
> in Perl but has since evolved to this question on list count evaluation.
> Would it be proper to have renamed this post subject line to something like
> "List counts <was: Re: "between" function equivalent in Perl?>"


Yes.


> preferred by this group to keep all related posts under the original
> discussion thread?


Changing the subject does not move the post out of the thread
(in newsreaders that do threading properly), so it will still be
in the original thread even after changing the Subject.


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


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

Date: Tue, 16 Sep 2003 04:32:26 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: boston perl classes with damian conway
Message-Id: <x7llsp2w17.fsf@mail.sysarch.com>


damian conway will be teaching these classes in boston:

	understanding regular expressions	monday sept. 29
	intermediate object oriented perl	tuesday sept. 20
	advanced module development		thur/fri oct 1-2

for more information and how to register go to:

	http://stemsystems.com/class/

remember, that even if you can't attend, if you sign up colleagues
and/or friends, you can earn a 5% commission. also the 50% discount for
students and underemployed is still available.

thanx,

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
Damian Conway Class in Boston - Sept 2003 -- http://www.stemsystems.com/class


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

Date: 16 Sep 2003 06:52:49 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: boston perl classes with damian conway
Message-Id: <slrnbmdcq1.cji.abigail@alexandra.abigail.nl>

Uri Guttman (uri@stemsystems.com) wrote on MMMDCLXVIII September MCMXCIII
in <URL:news:x7llsp2w17.fsf@mail.sysarch.com>:
))  
))  damian conway will be teaching these classes in boston:
))  
))  	understanding regular expressions	monday sept. 29
))  	intermediate object oriented perl	tuesday sept. 20
))  	advanced module development		thur/fri oct 1-2
))  
))  for more information and how to register go to:
))  
))  	http://stemsystems.com/class/
))  
))  remember, that even if you can't attend, if you sign up colleagues
))  and/or friends, you can earn a 5% commission. also the 50% discount for
))  students and underemployed is still available.


I've seen so many announcements of this, I'd consider it spam.

*PLONK*


Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


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

Date: 16 Sep 2003 07:11:39 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: boston perl classes with damian conway
Message-Id: <bk6d3b$nu6$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Abigail:

> Uri Guttman (uri@stemsystems.com) wrote on MMMDCLXVIII September MCMXCIII
> in <URL:news:x7llsp2w17.fsf@mail.sysarch.com>:
> ))  
> ))  damian conway will be teaching these classes in boston:
> ))  
> ))  	understanding regular expressions	monday sept. 29
> ))  	intermediate object oriented perl	tuesday sept. 20
> ))  	advanced module development		thur/fri oct 1-2
> ))  
> ))  for more information and how to register go to:
> ))  
> ))  	http://stemsystems.com/class/
> ))  
> ))  remember, that even if you can't attend, if you sign up colleagues
> ))  and/or friends, you can earn a 5% commission. also the 50% discount for
> ))  students and underemployed is still available.
> 
> 
> I've seen so many announcements of this, I'd consider it spam.
> 
> *PLONK*

Having had a bad start in the day, Abigail?. You did not really killfile
Uri, did you? 

Even though these classes are of no concern to me right now (I'm far
away from Boston), I still find such announcements interesting just in
order to see what's going on around Perl. Also, it's not there'd be an
awful lot of such postings.

Instead of regulars killfiling each other (which is a bad thing for this
group IMHO), maybe announcements like this should be flagged as such by
adding [ANN] or whatever to the subject. Thus, people could killfile on
subjects instead of plonking the poster.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: 16 Sep 2003 09:31:59 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: boston perl classes with damian conway
Message-Id: <slrnbmdm4f.emb.abigail@alexandra.abigail.nl>

Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on
MMMDCLXVIII September MCMXCIII in <URL:news:bk6d3b$nu6$1@nets3.rz.RWTH-Aachen.DE>:
$$  Also sprach Abigail:
$$  
$$ > Uri Guttman (uri@stemsystems.com) wrote on MMMDCLXVIII September MCMXCIII
$$ > in <URL:news:x7llsp2w17.fsf@mail.sysarch.com>:
$$ > ))  
$$ > ))  damian conway will be teaching these classes in boston:
$$ > ))  
$$ > ))  	understanding regular expressions	monday sept. 29
$$ > ))  	intermediate object oriented perl	tuesday sept. 20
$$ > ))  	advanced module development		thur/fri oct 1-2
$$ > ))  
$$ > ))  for more information and how to register go to:
$$ > ))  
$$ > ))  	http://stemsystems.com/class/
$$ > ))  
$$ > ))  remember, that even if you can't attend, if you sign up colleagues
$$ > ))  and/or friends, you can earn a 5% commission. also the 50% discount for
$$ > ))  students and underemployed is still available.
$$ > 
$$ > 
$$ > I've seen so many announcements of this, I'd consider it spam.
$$ > 
$$ > *PLONK*
$$  
$$  Having had a bad start in the day, Abigail?. You did not really killfile
$$  Uri, did you? 

I sure did.

$$  Even though these classes are of no concern to me right now (I'm far
$$  away from Boston), I still find such announcements interesting just in
$$  order to see what's going on around Perl. Also, it's not there'd be an
$$  awful lot of such postings.

I've seen it on about every Perl mailinglist and website I read.
It's just a commercial ad. I killfile people posting commercials
in this newsgroup. Why make exceptions?

$$  Instead of regulars killfiling each other (which is a bad thing for this
$$  group IMHO), maybe announcements like this should be flagged as such by
$$  adding [ANN] or whatever to the subject. Thus, people could killfile on
$$  subjects instead of plonking the poster.

No need for [ANN], given that there is a comp.lang.perl.announce
newsgroup. So, beside spam, it was off-topic as well.


Abigail
-- 
perl -wle'print"Êõóô áîïôèåò Ðåòì Èáãëåò"^"\x80"x24'


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

Date: Tue, 16 Sep 2003 08:59:42 GMT
From: f_baggins80@hotmail.com (Helgi Briem)
Subject: Re: Crypt::SSLeay
Message-Id: <3f66d0dd.60926457@News.CIS.DFN.DE>

On Mon, 15 Sep 2003 21:20:39 +0000 (UTC), Andreas Kahari
<ak+usenet@freeshell.org> wrote:

>In article <bk59gp$t3q$1@troll.powertech.no>, Vlad Tepes wrote:
>> A. Ma <ama@PW.CA> wrote:
>[cut]
>>> where I can find one? (The documentation from CPAN implied that compiling
>>> the module yourself is very problematic. That's why they suggested getting
>>> the PPM version from Activestate.)
>> 
>> http://ppm.activestate.com
>
>I had a quick look around there and yes, the build status says
>that Crypt::SSLeay does build on Windows, but their pages
>contains no link to any package.  Maybe it's just me who is
>unfamiliar with the packaging system they use (I'm a Unix guy).
>Hopefully A. Ma is able to make more use of the site than I did.

Open a command line window and type:

C:\>ppm install Crypt::SSLeay
--
Helgi Briem  hbriem AT simnet DOT is

Excuses the munged address.  My last
e-mail address was killed by spammers.


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

Date: Tue, 16 Sep 2003 08:28:20 GMT
From: "Sam" <samj@austarmetro.com.au>
Subject: date sorting module
Message-Id: <3f66c9a3$1@news.comindico.com.au>

Hello
I just came from cpan, after doing some searches and before I get a module,
wanted to ask if any one out there knows of a module that takes an array of
dates and sort them regardless of the date formate.

thanks




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

Date: Tue, 16 Sep 2003 08:33:58 +0000 (UTC)
From: Andreas Kahari <ak+usenet@freeshell.org>
Subject: Re: date sorting module
Message-Id: <slrnbmdinl.ja9.ak+usenet@vinland.freeshell.org>

In article <3f66c9a3$1@news.comindico.com.au>, Sam wrote:
> Hello
> I just came from cpan, after doing some searches and before I get a module,
> wanted to ask if any one out there knows of a module that takes an array of
> dates and sort them regardless of the date formate.

If the dates doesn't follow any pattern, how could you sort it?
Compare for example the US date format with som eof the European
ones:  Does one sort 9/7/2002 before or after 7/10/2002 if one
doesn't know what format they are on?


-- 
Andreas Kähäri


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

Date: Tue, 16 Sep 2003 00:31:49 -0700
From: "Tom" <tom@nosleep.net>
Subject: Re: HoH and MLDBM problems
Message-Id: <3f66bbbd$1@nntp0.pdx.net>

I have been trying to get the following to work for weeks and it just does
not.
No data gets stored like this as long as it is tied via tie or dbmopen.

>
> You can't store those data like that. When working with a tied hash, you
> can only store something in the top-level and not somewhere nested
> below. The above would have to read:
>
>     my %subhash;
>     $subhash{ $_ } = 1 for qw/apple orange banana/;
>     $db{ fruit } = \%subhash;
>


Any clues?
Thanks,
Tom




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

Date: Tue, 16 Sep 2003 01:13:35 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: javascript=escape() perl=(looking for equiv)
Message-Id: <slrnbmdagf.2ip.tadmc@magna.augustmail.com>

john <wenjoh26@emNOSPAMail@pct.edu> wrote:

> anybody know what the per equilivent to the javascript escape() function.


Maybe.

What does the javascript escape() function do?


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


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

Date: Tue, 16 Sep 2003 06:54:30 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: javascript=escape() perl=(looking for equiv)
Message-Id: <mbudash-C48CCD.23543015092003@typhoon.sonic.net>

In article <slrnbmdagf.2ip.tadmc@magna.augustmail.com>,
 tadmc@augustmail.com (Tad McClellan) wrote:

> john <wenjoh26@emNOSPAMail@pct.edu> wrote:
> 
> > anybody know what the per equilivent to the javascript escape() function.
> 
> 
> Maybe.
> 
> What does the javascript escape() function do?

judging by the javascript docs i use (oreilly's "javascript: the 
definitive guide"), he wants URI::Escape...

-- 
Michael Budash


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

Date: Tue, 16 Sep 2003 11:41:02 +0200
From: "Thomas Kratz" <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: need DBD::ODBC help
Message-Id: <3f66db29.0@juno.wiesbaden.netsurf.de>


"Andrew Burton" <tuglyraisin@aol.commcast> wrote in
news:20030915124946.03231.00000839@mb-m11.aol.com...
> I'm trying to get a Linux box, with RedHat 8 and Perl 5.8.0, to
connect with an
> AS400 machine through ODBC.  I'm fairly sure I can get it to
connect, because I
> don't get an error until I try to use $db->prepare(). I will
post the code and
> errors below.  I get two errors, but I am fairly sure the second
error is a
> result of the first.

Yep.

> My main questions, to anyone who has written a Perl
> script/program that connects to an IBM machine, are three-fold:
>
> 1. What am I doing wrong?
>
> 2. Should I be using DBD::DB2?
>
> 3. If so, what kind of drivers do I need to use DBD::DB2?
>
> Thanks for any help, as me and my boss have spent a good bit of
time digging
> through IBM sites, the Usenet, and the web.  Thanks.  Here's the
bit of code
> I'm using to "prototype" a connection:
>
> [code]
> #!/usr/bin/perl -w
>
> use strict;
> use DBI;
>
> my $db = DBI->connect('dbi:ODBC:AS400', 'myid', 'mypassword')
or die
> $DBI::errstr;

# write a tracefile, perhaps you'll get a better error message.
# raise the tracelevel for more info (--> perldoc DBI)
$db->trace(3, 'trace.log');

> my $out = $db->prepare("SELECT * FROM CD02 WHERE CD02_INSTRNO =
'4110'");
> $out->execute() or die $DBI::errstr;

$out will be undefined when the prepare fails. You should check
that.

[snipped the rest]

Thomas




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

Date: Tue, 16 Sep 2003 09:53:50 +0100
From: Tim Haynes <thaynes@openlinksw.com>
Subject: Re: need DBD::ODBC help
Message-Id: <877k49jeqp.fsf@purple.uknet.private>

tuglyraisin@aol.commcast (Andrew Burton) writes:

> use strict;
> use DBI;
>
> my $db = DBI->connect('dbi:ODBC:AS400', 'myid', 'mypassword')  or die
> $DBI::errstr;
>
> my $out = $db->prepare("SELECT * FROM CD02 WHERE CD02_INSTRNO = '4110'");
> $out->execute() or die $DBI::errstr;
[snip]
> ...and here are the errors I get:
>
> [errors]
> DBD::ODBC::db prepare failed: [unixODBC][IBM][iSeries Access ODBC Driver][DB2
> UDB] (SQL-HY000)
> [unixODBC][IBM][iSeries Access ODBC Driver][DB2 UDB] (SQL-42S02)(DBD:
> st_prepare/SQLPrepare err=-1) at ./odbctest line 8.
> Can't call method "execute" on an undefined value at ./odbctest line 9.
> [/errors]

Well, the prepare is failing for some strange reason. Can you execute this
as a simple `do' query, ie

 | $rv  = $db->do($statement);

?

Also, what about trying to execute the same statement against the same DSN
using either unixODBC's `isql' tool, or iODBC's `iodbctest'? Any errors
there?

~Tim
-- 
Product Development Consultant
OpenLink Software
Tel: +44 (0) 20 8681 7701
Web: <http://www.openlinksw.com>
Universal Data Access & Data Integration Technology Providers


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

Date: Tue, 16 Sep 2003 07:03:27 GMT
From: "\"Dandy\" Randy" <ducott@hotmail.com>
Subject: Pausing a script
Message-Id: <3By9b.960867$ro6.19067812@news2.calgary.shaw.ca>

Hello, could use some help finding a way to pause my script for a
predetermined interval during a loop. I have a script that gets some data
for a text file and gathers it into an @array. See below.

open (ADDRESSES, "<data/addresses.txt") or die "Can't open file: $!";
  @list=<ADDRESSES>;
close(ADDRESSES);

foreach $list(@list) {
perform function #1
perform function #2
pause 3 seconds
}

I would like a 3 second pause during the above foreach loop. How might I
accomplish this? Thanx!

Randy




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

Date: Tue, 16 Sep 2003 07:08:15 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Pausing a script
Message-Id: <3f66b6cf.207169965@news.erols.com>

"\"Dandy\" Randy" <ducott@hotmail.com> wrote:

: I would like a 3 second pause

    sleep(3);



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

Date: Tue, 16 Sep 2003 07:28:29 GMT
From: "\"Dandy\" Randy" <ducott@hotmail.com>
Subject: Re: Pausing a script
Message-Id: <xYy9b.158227$la.3349247@news1.calgary.shaw.ca>

"Jay Tilton" <tiltonj@erols.com> wrote:

> : I would like a 3 second pause
>     sleep(3);

Can this code be configured to only pause for half a second? like this
sleep(0.5); or something sililair?

Randy




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

Date: Tue, 16 Sep 2003 07:25:56 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Pausing a script
Message-Id: <mbudash-9AB33B.00255716092003@typhoon.sonic.net>

In article <3By9b.960867$ro6.19067812@news2.calgary.shaw.ca>,
 "\"Dandy\" Randy" <ducott@hotmail.com> wrote:

> Hello, could use some help finding a way to pause my script for a
> predetermined interval during a loop. I have a script that gets some data
> for a text file and gathers it into an @array. See below.
> 
> open (ADDRESSES, "<data/addresses.txt") or die "Can't open file: $!";
>   @list=<ADDRESSES>;
> close(ADDRESSES);
> 
> foreach $list(@list) {
> perform function #1
> perform function #2
> pause 3 seconds
> }
> 
> I would like a 3 second pause during the above foreach loop. How might I
> accomplish this? Thanx!
> 
> Randy
> 
> 

perldoc -f sleep

-- 
Michael Budash


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

Date: Tue, 16 Sep 2003 07:34:46 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Pausing a script
Message-Id: <mbudash-3018FB.00344716092003@typhoon.sonic.net>

In article <xYy9b.158227$la.3349247@news1.calgary.shaw.ca>,
 "\"Dandy\" Randy" <ducott@hotmail.com> wrote:

> "Jay Tilton" <tiltonj@erols.com> wrote:
> 
> > : I would like a 3 second pause
> >     sleep(3);
> 
> Can this code be configured to only pause for half a second? like this
> sleep(0.5); or something sililair?
> 
> Randy
> 
> 

i say again:

perldoc -f sleep

RTFM

-- 
Michael Budash


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

Date: Tue, 16 Sep 2003 16:22:47 +0900
From: ko <kuujinbo@hotmail.com>
Subject: Re: Pausing a script
Message-Id: <bk6dqo$8sg$1@pin3.tky.plala.or.jp>

"Dandy" Randy wrote:
> Hello, could use some help finding a way to pause my script for a
> predetermined interval during a loop. I have a script that gets some data
> for a text file and gathers it into an @array. See below.
> 
> open (ADDRESSES, "<data/addresses.txt") or die "Can't open file: $!";
>   @list=<ADDRESSES>;
> close(ADDRESSES);
> 
> foreach $list(@list) {
> perform function #1
> perform function #2
> pause 3 seconds
> }
> 
> I would like a 3 second pause during the above foreach loop. How might I
> accomplish this? Thanx!
> 
> Randy
> 
> 

Replace 'pause 3 seconds' with 'sleep 3' in your script.

'perldoc -f sleep' gives you all the details


HTH - keith



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

Date: Tue, 16 Sep 2003 09:47:15 +0200
From: =?ISO-8859-15?Q?S=E9bastien?= Cottalorda <sppNOSPAM@monaco377.com>
Subject: Re: Pb with IO::Socket::INET and recv
Message-Id: <3f66c003$0$27577$626a54ce@news.free.fr>

Sébastien Cottalorda wrote:

> Hi all,
> Since I migrate a client program to Mandrake 9.1 (kernel 2.4.21-0.13) and
> perl 5.8.0, this little program didn't work.
> The problem occured on the
>         unless(recv...) line
> It always return me "false" => my program think that there was an error.
> If I remove the unless (recv...) check, it seems to work.
> 
> 
> Thanks in advance for any kind of help.
> 
> Sébastien
> 
> 
> 
> #!/usr/bin/perl -w
> use IO::Socket;
> use IO::Select;
> use strict;
> my $end_car="\r";
> my $time_out_sending = my $time_out_receiving = 30;
> my @recep = &envoie("Hello, How are you","192.168.0.1","45678","");
> foreach (@recep){ print "$_\n"}
> exit;
> 
> 
> sub envoie {
>     my $to_send = $_[0];
>     my $adr_ip= $_[1];
>     my $por = $_[2];
>     my $socket='';
>     #=========================/ Socket creation \=========================
>     unless ($socket = IO::Socket::INET->new(PeerAddr=> $adr_ip,
>                                 PeerPort=> $por,
>                                 Proto=> "tcp",
>                                 Timeout=>10,
>                                 Type=> SOCK_STREAM))
>     {
>         return "Cannot connect to $adr_ip:$por $@";
>     }
>     my $s=IO::Select->new();
>     $s->add($socket);
>     #==========================/ Sending \================================
>     if ($s->can_write($time_out_sending)){
>         unless ($socket->send("$to_send"."$end_car",'')){  #>>>> SENDING
>             $s->remove($socket);
>             close($socket);
>             return "Cannot Send $!";
>         }
>     }
>     else {   #------------> Time out <-------------
>         $s->remove($socket);
>         close($socket);
>         return "TIME OUT sending datas";
>     }
>     #=========================/ Receiving \===============================
>     my $data_read="";
>     if ($s->can_read($time_out_receiving)){
>         unless ($socket->recv($data_read,'1024')){    #<<<<< PROB HERE
>             $s->remove($socket);                      # Always executed
>             close($socket);                           #   "       "
>             return "Cannot Receive $!";               #   "       "
>         }
>         $s->remove($socket);
>         close($socket);
>         return $data_read;
>     }
>     else {   #------------> Time out <-------------
>         $s->remove($socket);
>         close($socket);
>         return "TIME OUT receiving datas";
>     }
> }
> 

Solved problem !!!!

unless (defined $socket->recv($data_read, 1024, 0));

Thanks to Paul GABORIT.

Sébastien


-- 
[ retirer NOSPAM pour répondre directement
 remove NOSPAM to reply directly ]


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

Date: Tue, 16 Sep 2003 01:11:33 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl way to do PHP includes?
Message-Id: <slrnbmdacl.2ip.tadmc@magna.augustmail.com>

Garry Heaton <none@none.com> wrote:

> 2. open FILE, "< $perl_file";


You should always, yes *always*, check the return value from open():

   open FILE, $perl_file or die "could not open '$perl_file'  $!";


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


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

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.  

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 5509
***************************************


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