[22819] in Perl-Users-Digest
Perl-Users Digest, Issue: 5040 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 26 03:05:32 2003
Date: Mon, 26 May 2003 00:05:07 -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 Mon, 26 May 2003 Volume: 10 Number: 5040
Today's topics:
does this make sence ? (about undef error on select) <webmaster@neverseenbefore.com>
Re: From a script to another one - More details invalid@no.address
Re: How do I make a graph with this module? (entropy123)
Re: Net::AIM help! <rm.mymail@NOSPAMHEREntlworld.com>
Re: Net::AIM help! (Mark A. Hershberger)
Perl Script to Caluclate Averages? (Spread Eagle)
Re: Perl Script to Caluclate Averages? <palladium@spinn.net>
Re: Perl Script to Caluclate Averages? (Sam Holden)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 26 May 2003 07:10:55 +0200
From: "Dieter D'Hoker" <webmaster@neverseenbefore.com>
Subject: does this make sence ? (about undef error on select)
Message-Id: <bas7m2$2u09i$1@ID-155251.news.dfncis.de>
I'm running a perl game server ,
but I keep getting this shutdown error every few days :
Can't use an undefined value as a symbol reference at
/usr/libdata/perl/5.00503/mach/IO/Select.pm line 57.
( $@ and $! are empty in my Sig DIE_ )
I guess this is because in "my @ready =
IO::Select->select($Misc{readable}, $Misc{writable}, undef, SELECTINTERVAL);
"
selects gets an undef (that's in $Misc{readable}or $Misc{writable}) .
I tried checking everything else when i adding a file handle checking if
it's undef :
"
if (defined $new and ($new ne undef) ) {
$Misc{readable}->add($new);"
}
"
etc. etc.
but I keep getting these errors ...
(BTW there is 10.000 lines of code it's kinda hard to check every last line
of it )
so I thought , is there a way to check if there is a way to check all
handles if they are undef or not before using the select call ,
so I came up with this , but I don't know if it makes any sence or will just
slow down my server (ping is very important on a gameserver ) :
"
my @readhandles = $Misc{readable}->handles;
my @writehandles = $Misc{writable}->handles;
foreach my $s (@readhandles)
{
if ($s == undef) { $Misc{readable}->remove($s) ; }
}
foreach my $s (@writehandles)
{
if ($s == undef) { $Misc{writable}->remove($s) ; }
}
my @ready = IO::Select->select($Misc{readable}, $Misc{writable}, undef,
SELECTINTERVAL);
"
maybe someone has another solution ?
Or some thouts on this matter ?
The shell I'm running the server on still uses version 5.005_03 (freebsd) ,
maybe it's a "bug" in that old version of perl ?
--
Dieter D'Hoker
http://dieter.dhoker.com/
news:free.nl.dieter.dhoker & news:alt.nl.fan.dieter.dhoker
Tetrinet SeRVer : TSRV.COM
------------------------------
Date: Mon, 26 May 2003 10:35:42 +0400
From: invalid@no.address
Subject: Re: From a script to another one - More details
Message-Id: <5uc3dvcnjmpua6n07ghvuorqcv5rasmm2b@4ax.com>
Thank you for those who tried to help, but I think I didn't explain
correctly my problem :-)
I have a perl subroutine (sub routine) in a file script2.pm (not pl,
pm).
This script2.pm is NOT a perl script, simply a file of routines.
From script1.pl, I need to do &routine with passing some parameters
param1, param2, etc.
The sub routine will create files using the parameters that are
passed.
*normally*, I don't need to have any return about the success, errors
etc, as all has been checked before arriving at the &routine... But
some retunr would probably be better, at least something to show if
all has been done correctly !
What I wrote about the URL here:
> the call to script2.pl COULD be done by something like
> http://domain/path/script2.pl?param1=1¶m2=2
means that the process CAN be done using such a link calling
script2.pl; this script2 pl USES script2.pm ! I thought that it would
help to understand what I want to do.
Thank you for your time !
Paul
------------------------------
Date: 25 May 2003 21:51:52 -0700
From: email_entropy123@yahoo.com (entropy123)
Subject: Re: How do I make a graph with this module?
Message-Id: <90cdce37.0305252051.23d9e83@posting.google.com>
>
> Hmm, having taken a closer look at that documentation, I get your
> drift. The documentation is simply an ultra-terse description of the
> methods.
>
> If I were in your shoes at this point, I'd go back to search.cpan.org
> and plug "Graph" into the search engine. The _next_ module that comes
> up, Martin Viebruggen's GDGraph, looks more promising. There's even
> an FAQ as part of the docs! (Note: I haven't tried any of these
> myself.)
James,
That isn't the half of it, I came across the module as part of the
'Mastering Algorithms with Perl' OReilly book and they don't explain
how to really do anything in there either. Lots of code, but they are
missing the critical step of how to actually take raw data and create
a graph.. ?
I had the same problem with 'Learning Perl', but I managed to work my
way through it with help from this group...
Anyway, thanks!
I'll check out GDGraph...
entropy
------------------------------
Date: Mon, 26 May 2003 05:27:24 +0100
From: "Richard Mahoney" <rm.mymail@NOSPAMHEREntlworld.com>
Subject: Re: Net::AIM help!
Message-Id: <FIgAa.12679$sJ4.10736@newsfep4-winn.server.ntli.net>
"Steven Danna" <MissingWords@hotmail.com> wrote in message
news:e78d8c5a.0305251640.39f8d0df@posting.google.com...
> "Richard Mahoney" <rm.mymail@NOSPAMHEREntlworld.com> wrote in message
news:<Re6za.10403$Mu3.200136@newsfep4-glfd.server.ntli.net>...
> After doing a little digging around I found that there is a method
> that doesn't seem to be presented in Net::AIM documentation(at least
> in v1.22). This is the $aim->set_handler() method. I have found a test
> script which seems to work very well. This script can be found here:
>
> http://www.aryeh.net/Net-AIM/aimtest
>
> I have used this script and it seems to work well; however, I am
> still trying to dig through it to figure out exactly what is needed to
> just send a message. From what I can see so far the set_handler
> method assigns certain subroutines to execute when certain signals are
> gotton for instance:
>
>
> sub on_config {
> my ($self, $evt, $from, $to) = @_;
>
> my $str = shift @{$evt->args()};
> $self->set_config_str($str, 1);
>
> # $self->send_buddies;
> $self->send_config();
> }
>
> $conn->set_handler('config', \&on_config);
>
> the 'config' handler seems to be inportant(it may be that the AOL
> server sends this "signal"(if it can really be called that) shortly
> after a connection is made). Unfortunatly, when i tried to implement
> a script like yours with the addition of the 'config' handler it still
> failed to do anything.
>
> I hope some of this can help you in your search. I wanted to get a
> working example before I posted but I have a feeling that someone else
> may be able to figure it out long before I do.
I did try the above as well but it failed.
The "$aim->start;" command is basically a loop but I have no idea how to
insert the SendIM command into the middle of it.
I have emailed the author of the module but I doubt if I'll get a response.
Shame really because it would be a useful script, especially considering
what the alternatives are such as MSN with it's nightmare encrypted
switchboard servers...
RM.
------------------------------
Date: Mon, 26 May 2003 01:23:04 -0500
From: mah@everybody.org (Mark A. Hershberger)
Subject: Re: Net::AIM help!
Message-Id: <87brxqxm47.fsf@batman.everybody.org>
"Richard Mahoney" <rm.mymail@NOSPAMHEREntlworld.com> writes:
> Shame really because it would be a useful script, especially considering
> what the alternatives are such as MSN with it's nightmare encrypted
> switchboard servers...
There are alternatives. Net::Jabber works for me.
Mark.
--
As long as you have mystery you have health; when you destroy mystery
you create morbidity. -- G.K. Chesterson
------------------------------
Date: 25 May 2003 21:58:35 -0700
From: redsky@virtualhosts.net (Spread Eagle)
Subject: Perl Script to Caluclate Averages?
Message-Id: <7059619f.0305252058.1f2faad4@posting.google.com>
I'm trying to teach myself perl, and am just getting the basics down.
I want to write a script that would allow the user to enter a sequence
of numbers from the standard input, it would then calculate the
average of those numbers, then print that average on the standard
output. Can someone show mw a sample script for that? I keep getting
compile arrors and syntax errors.
Thanks.
------------------------------
Date: Mon, 26 May 2003 00:12:19 -0600
From: "Rodney" <palladium@spinn.net>
Subject: Re: Perl Script to Caluclate Averages?
Message-Id: <vd3bhe40pq1b86@corp.supernews.com>
"Spread Eagle" <redsky@virtualhosts.net> wrote in message
news:7059619f.0305252058.1f2faad4@posting.google.com...
> I'm trying to teach myself perl, and am just getting the basics down.
> I want to write a script that would allow the user to enter a sequence
> of numbers from the standard input, it would then calculate the
> average of those numbers, then print that average on the standard
> output. Can someone show mw a sample script for that? I keep getting
> compile arrors and syntax errors.
>
> Thanks.
Any chance of sharing what you've tried? Then we could target "your" problem
head on. Otherwise we can't help much.....We already know how to do this
"our" way.
------------------------------
Date: 26 May 2003 05:23:38 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Perl Script to Caluclate Averages?
Message-Id: <slrnbd396q.gvn.sholden@flexal.cs.usyd.edu.au>
On 25 May 2003 21:58:35 -0700, Spread Eagle <redsky@virtualhosts.net> wrote:
> I'm trying to teach myself perl, and am just getting the basics down.
> I want to write a script that would allow the user to enter a sequence
> of numbers from the standard input, it would then calculate the
> average of those numbers, then print that average on the standard
> output. Can someone show mw a sample script for that? I keep getting
> compile arrors and syntax errors.
Post what you have (assumming it isn't too long, in which case shorten it
first).
Then people will be able to help, otherwise the homework smell is too strong.
If it actually is homework and you just want it done for you then submit
this:
undef $/;
$_ = <>;
s/^\s*//;
s/\s*$//;
$c = s/\s+/+/g + 1;
print eval($_)/$c,"\n";
--
Sam Holden
------------------------------
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 5040
***************************************