[24031] in Perl-Users-Digest
Perl-Users Digest, Issue: 6228 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 6 21:05:42 2004
Date: Sat, 6 Mar 2004 18: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 Sat, 6 Mar 2004 Volume: 10 Number: 6228
Today's topics:
Converting OLE objects <PKalampukattussery@nc.rr.com>
Re: Converting OLE objects <jwillmore@remove.adelphia.net>
CPAN shell complains about MD5 <carpenter@construction.net>
Re: HOW TO CHECK URL?? <tore@aursand.no>
Re: HOW TO CHECK URL?? <thomas.deschepper.ecol@sintjozefscollege.be>
Re: HOW TO CHECK URL?? <tadmc@augustmail.com>
Re: local and my variables in a subroutine <tadmc@augustmail.com>
MS SQL 2000 anonymous@coolgroups.com
Re: MS SQL 2000 <usenet@morrow.me.uk>
need help for a regex <chpshi@stonix.com>
Re: need help for a regex <tadmc@augustmail.com>
Need info: (Sean Holt)
Re: Need info: <tadmc@augustmail.com>
Re: Perl program and database locked but alive <theforce@forcet.net>
Re: Perl program and database locked but alive (Jay Tilton)
Re: Perl program and database locked but alive <theforce@forcet.net>
Re: Perl program and database locked but alive <gnari@simnet.is>
Re: Perl program and database locked but alive <theforce@forcet.net>
Re: regexp <tadmc@augustmail.com>
Re: REQ: Perl 5.8.3 on OpenBSD <usenet@morrow.me.uk>
Re: REQ: Perl 5.8.3 on OpenBSD <jefflapointe@sbcglobal.net>
Re: REQ: Perl 5.8.3 on OpenBSD <usenet@morrow.me.uk>
Re: serializing access to a resource in my mod_perl Per <gnari@simnet.is>
Re: Slow Sorting <tadmc@augustmail.com>
Re: socket communication / callback <usenet@morrow.me.uk>
Re: triggering callback from "outside" <usenet@morrow.me.uk>
Re: triggering callback from "outside" ctcgag@hotmail.com
Re: What with this open file descriptor/"Read on closed (Rex Gustavus Adolphus)
Re: What with this open file descriptor/"Read on closed (Rex Gustavus Adolphus)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 07 Mar 2004 00:42:16 GMT
From: "Pradeep George Jacob Kalampukattussery" <PKalampukattussery@nc.rr.com>
Subject: Converting OLE objects
Message-Id: <Idu2c.71930$eL2.4152815@twister.southeast.rr.com>
Hello-
I have OLE objects (mostly word and excel) stored in a field in an Oracle
database. I need to extract them and save them as files on the filesystem
(MS Word and MS Excel files).
I used the DBI module to query the database and get the OLE into a scalar
variable - I read through the Win32::OLE module but didn't get a clue on how
to convert data stored in a variable and save as a file.
Maybe there is a better approach to what I need to do.
I seek advice from the experts or some examples if any of you have stumbled
with similar needs.
Thanks in advance and appreciate all your help,
Pradeep
------------------------------
Date: Sat, 06 Mar 2004 20:03:44 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Converting OLE objects
Message-Id: <pan.2004.03.07.01.03.43.71309@remove.adelphia.net>
On Sun, 07 Mar 2004 00:42:16 +0000, Pradeep George Jacob Kalampukattussery
wrote:
> Hello-
> I have OLE objects (mostly word and excel) stored in a field in an Oracle
> database. I need to extract them and save them as files on the filesystem
> (MS Word and MS Excel files).
> I used the DBI module to query the database and get the OLE into a scalar
> variable - I read through the Win32::OLE module but didn't get a clue on how
> to convert data stored in a variable and save as a file.
> Maybe there is a better approach to what I need to do.
You might be able to save the information stored in the scalar to a file
using 'binmode'. My thinking is - if it's stored in binary format in the
database, then using 'binmode' may be the way to go.
So, you would code something like this (untested):
open(MSFILE, 'msfile.doc') or die "Can't open MS File: $!\n";
binmode MSFILE;
print MSFILE $blob;
close MSFILE;
`perldoc -f binmode` for more info.
Just a guess and HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Art is either plagiarism or revolution. -- Paul Gauguin
------------------------------
Date: Sat, 06 Mar 2004 18:48:48 -0600
From: Bill Ding <carpenter@construction.net>
Subject: CPAN shell complains about MD5
Message-Id: <8fqk405tcrt4dc4qv6dq66m4jbhtpcermv@4ax.com>
Background:
I've been writing some code with xharbour (for DBM) and perl, to check
out eBay auctions. Stuff's working pretty nicely so far... for
example, I can give it a query (like "(cat,dog) +(grooming,shampoo)"
and get URL, descriptions, categories, number of bids, buynow status
for all 482 auctions in a browseable database in just s few seconds,
then kick off a lynx session (and no doubt other browsers later, but
I'm working in terminal mode right now) for any given item with a
single keystroke... so far, so good.
The Problem:
I was checking out Schilli's ebay code as shown in Feb 04 (European)
Linux Magazine, and it's got a sidebar titled "ebaywatch requirements"
directing the use of the CPAN shell (which I've never used before). So
I figured, heck, this looks simpler than screwing around searching for
modules, downloading, uncompressing, make-ing, etc etc etc. So... the
config process seemed to go okay, but when I got to the install
WWW::Search::Ebay, it complained about MD5 and wouldn't proceed... in
fact, everything I tried complained about MD5, specifically:
'Can't locate object method "new" via package MD5
(perhaps you forgot to load "MD5"?) at
/usr/lib/local/perl5/5.6.1/CPAN.pm line 4212'
except install MD5, which proclaimed "MD5 is up to date."
Hmmmm... it's up to date, but it's not there. What gives, and how to
fix it?
------------------------------
Date: Sat, 06 Mar 2004 22:50:37 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: HOW TO CHECK URL??
Message-Id: <pan.2004.03.06.21.50.26.978346@aursand.no>
On Sat, 06 Mar 2004 23:14:19 +0800, news.hinet.net wrote:
>> HTTP://123.22.1.33 TRUE
>> HTTP://123.22.1.333 FAIL
>> http://123.22.1 fail
>>
>> ftp://abc.efg.net true
>> ftp://abc.efg.nnn fail
>> http://abc.efg*.net fail
> i just want to using regular express to check url
1. Don't top-post.
2. Don't post an answer to your own post if it's not an answer to
your own post.
3. Regexp::Common
--
Tore Aursand <tore@aursand.no>
"War is too serious a matter to entrust to military men." -- Georges
Clemenceau
------------------------------
Date: Sat, 06 Mar 2004 23:01:07 +0100
From: Thomas Deschepper <thomas.deschepper.ecol@sintjozefscollege.be>
Subject: Re: HOW TO CHECK URL??
Message-Id: <pan.2004.03.06.22.01.07.291889@sintjozefscollege.be>
On Sat, 06 Mar 2004 23:42:43 +1000, Gregory Toomey wrote:
<snip>
> Check out LWP::Simple (get) & LWP::UserAgent in www.cpan.org
>
> gtoomey
LWP::Simple->head($url) you mean :)
------------------------------
Date: Sat, 6 Mar 2004 18:40:30 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: HOW TO CHECK URL??
Message-Id: <slrnc4krru.k12.tadmc@magna.augustmail.com>
Thomas Deschepper <thomas.deschepper.ecol@sintjozefscollege.be> wrote:
> On Sat, 06 Mar 2004 23:42:43 +1000, Gregory Toomey wrote:
>
><snip>
>
>> Check out LWP::Simple (get) & LWP::UserAgent in www.cpan.org
>>
>> gtoomey
>
> LWP::Simple->head($url) you mean :)
Since some servers may not respond to head requests,
LWP::Simple->head($url) or LWP::Simple->get($url)
you mean. :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 6 Mar 2004 17:31:30 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: local and my variables in a subroutine
Message-Id: <slrnc4knqi.j83.tadmc@magna.augustmail.com>
Bob Walton <invalid-email@rochester.rr.com> wrote:
> Phil Jacobson wrote:
>> I understand if I put the subroutine at the bottom of the code it
>> will work with all the arrays my'd.
> Try putting your sub after the main program code. Then it will work
> fine.
I think he already knew that. :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 07 Mar 2004 00:23:19 GMT
From: anonymous@coolgroups.com
Subject: MS SQL 2000
Message-Id: <a705c69e8a88f6b57ca77a318250127d@news.scbiz.com>
Does anyone know how to connect to an MS SQL 2000 db from
Perl?
thanks.
------------------------------
Date: Sun, 7 Mar 2004 01:15:45 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: MS SQL 2000
Message-Id: <c2dt41$juh$1@wisteria.csv.warwick.ac.uk>
anonymous@coolgroups.com wrote:
> Does anyone know how to connect to an MS SQL 2000 db from
> Perl?
I have had success (under linux) with DBI and DBD::Sybase. From Windows
I guess you can use DBD::ODBC.
Ben
--
don't get my sympathy hanging out the 15th floor. you've changed the locks 3
times, he still comes reeling though the door, and soon he'll get to you, teach
you how to get to purest hell. you do it to yourself and that's what really
hurts is you do it to yourself just you, you and noone else ** ben@morrow.me.uk
------------------------------
Date: Sat, 6 Mar 2004 19:19:10 -0500
From: "Alex Shi" <chpshi@stonix.com>
Subject: need help for a regex
Message-Id: <BQt2c.74372$%P1.36573@nntp-post.primus.ca>
Hello folks,
I want to retrieve full name, city name, state and country from
following string:
"(Firstname Lastname - Traverse City, MI United States)"
I think maybe a regex can be a solution. However I don't have
much knowledge on it. I need help. Thanks in advance!
Alex Shi
------------------------------
Date: Sat, 6 Mar 2004 18:38:07 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: need help for a regex
Message-Id: <slrnc4krnf.k12.tadmc@magna.augustmail.com>
Alex Shi <chpshi@stonix.com> wrote:
> I want to retrieve full name, city name, state and country from
Errr, what if the "country" does not _have_ "states"?
What if the country's states are not represented with
two upper case letters?
> following string:
> "(Firstname Lastname - Traverse City, MI United States)"
>
> I think maybe a regex can be a solution.
------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
$_ = '(Firstname Lastname - Traverse City, MI United States)';
if ( /\(([^-]*)\s*-\s*([^,]*),\s*([A-Z]{2})\s*([^)]*)/ ) {
print "name: $1\n";
print "city: $2\n";
print "state: $3\n";
print "country: $4\n";
}
------------------------------------
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Mar 2004 16:23:21 -0800
From: mordist1@cox.net (Sean Holt)
Subject: Need info:
Message-Id: <f9a2536.0403061623.61f5f117@posting.google.com>
Hello,
What I need to do is to have a Perl script on one server, which
access another script on a different server through an HTTP request.
Now, this is the simple part. What I need to do is make the request
from the persons IP/Host, not the servers. So basically it would look
like this :
User connects to my server.
my server connects to 3rd party host/script.
3rd party host/script needs to see that users IP/hostnane, not my
servers.
I don't even know if I explained this well. Or if this is even
possible to do.
Any advice/help would be greatly appreciated.
Tbanks,
Sean
------------------------------
Date: Sat, 6 Mar 2004 18:38:58 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Need info:
Message-Id: <slrnc4krp2.k12.tadmc@magna.augustmail.com>
Sean Holt <mordist1@cox.net> wrote:
> Subject: Need info:
Need subject in Subject.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 6 Mar 2004 12:40:49 -0800
From: "TF" <theforce@forcet.net>
Subject: Re: Perl program and database locked but alive
Message-Id: <404a3f3b$1@nntp0.pdx.net>
"TF" <theforce@forcet.net> wrote in message news:404947d8$1@nntp0.pdx.net...
> Is there any way to intervene with a program that is still running, but
> locked during database read/write subs, to see where the lockup is coming
> from?
> This problem cannot be repeated and is the result of web page data
> corruption, or storage of said data.
>
> Thanks
>
O.K., more info.
Can't post any code, as it is over 15K lines.
I'm getting data from the web and storing it into an MLDBM database.
The hang is most likely one of the following:
1) Non-response from web request, though I'm not sure if this can happen.
2) The data checking routine has gone into a loop.
3) Corrupt data has been input into the database causing a lockup on future
access.
The ties & unties are all checked and O.K., so it can't be that.
If I can just intervene and find out what line of code it is hung on, would
be great.
No cgi is involved here.
Thanks
------------------------------
Date: Sat, 06 Mar 2004 21:42:26 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Perl program and database locked but alive
Message-Id: <404a427c.181468614@news.erols.com>
"TF" <theforce@forcet.net> wrote:
: "TF" <theforce@forcet.net> wrote in message news:404947d8$1@nntp0.pdx.net...
: > Is there any way to intervene with a program that is still running, but
: > locked during database read/write subs, to see where the lockup is coming
: > from?
: > This problem cannot be repeated and is the result of web page data
: > corruption, or storage of said data.
:
: O.K., more info.
: Can't post any code, as it is over 15K lines.
:
: I'm getting data from the web and storing it into an MLDBM database.
:
: The hang is most likely one of the following:
:
: 1) Non-response from web request, though I'm not sure if this can happen.
: 2) The data checking routine has gone into a loop.
: 3) Corrupt data has been input into the database causing a lockup on future
: access.
:
: The ties & unties are all checked and O.K., so it can't be that.
:
: If I can just intervene and find out what line of code it is hung on, would
: be great.
A simple signal handler could help there.
use Carp qw(confess);
$SIG{ 'INT' } = sub { confess "Signal caught" };
Then the process will terminate with a call stack backtrace when you send
that signal to it. See perlvar and perlipc for details.
: No cgi is involved here.
Huh? Where is the "web request" coming from if not through CGI?
------------------------------
Date: Sat, 6 Mar 2004 15:54:54 -0800
From: "TF" <theforce@forcet.net>
Subject: Re: Perl program and database locked but alive
Message-Id: <404a6cb9@nntp0.pdx.net>
"Jay Tilton" <tiltonj@erols.com> wrote in message
news:404a427c.181468614@news.erols.com...
> "TF" <theforce@forcet.net> wrote:
>
> : "TF" <theforce@forcet.net> wrote in message
news:404947d8$1@nntp0.pdx.net...
> : > Is there any way to intervene with a program that is still running,
but
> : > locked during database read/write subs, to see where the lockup is
coming
> : > from?
> : > This problem cannot be repeated and is the result of web page data
> : > corruption, or storage of said data.
> :
> : O.K., more info.
> : Can't post any code, as it is over 15K lines.
> :
> : I'm getting data from the web and storing it into an MLDBM database.
> :
> : The hang is most likely one of the following:
> :
> : 1) Non-response from web request, though I'm not sure if this can
happen.
> : 2) The data checking routine has gone into a loop.
> : 3) Corrupt data has been input into the database causing a lockup on
future
> : access.
> :
> : The ties & unties are all checked and O.K., so it can't be that.
> :
> : If I can just intervene and find out what line of code it is hung on,
would
> : be great.
>
> A simple signal handler could help there.
>
> use Carp qw(confess);
> $SIG{ 'INT' } = sub { confess "Signal caught" };
>
> Then the process will terminate with a call stack backtrace when you send
> that signal to it. See perlvar and perlipc for details.
Thanks, I will.
>
> : No cgi is involved here.
>
> Huh? Where is the "web request" coming from if not through CGI?
LPW
>
------------------------------
Date: Sat, 6 Mar 2004 22:24:42 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Perl program and database locked but alive
Message-Id: <c2dj1b$2qr$1@news.simnet.is>
"Jay Tilton" <tiltonj@erols.com> wrote in message
news:404a427c.181468614@news.erols.com...
> "TF" <theforce@forcet.net> wrote:
[snip lockup description]
>
> : No cgi is involved here.
>
> Huh? Where is the "web request" coming from if not through CGI?
I understand it as the script is doing a series of HTTP client requests
and does some checks and stores some results to a database
in that case it is not a question of database deadlocks the original
post gave me the oimpression of , unless multiple parallel requests
are being made, in which case file locking on the database needs to
be done.
To TF:
I suggest you just do more debugging, such as logging to a file
extensively, store on disk last input file, and so on.
then when lockup happens, tail the log file to see where in the
script you where, look at the last input and so on.
then you might feed your script the last stored input again, to see if
it is the data that does it. I am sure you have better ideas than us
on how to debug your program, but the main rule is to strip away
everything that is not needed to exhibit your problem, until what
is left is so little that it becomes obvious.
gnari
------------------------------
Date: Sat, 6 Mar 2004 18:04:17 -0800
From: "TF" <theforce@forcet.net>
Subject: Re: Perl program and database locked but alive
Message-Id: <404a8b09$1@nntp0.pdx.net>
"gnari" <gnari@simnet.is> wrote in message
news:c2dj1b$2qr$1@news.simnet.is...
> "Jay Tilton" <tiltonj@erols.com> wrote in message
> news:404a427c.181468614@news.erols.com...
> > "TF" <theforce@forcet.net> wrote:
> [snip lockup description]
> >
> > : No cgi is involved here.
> >
> > Huh? Where is the "web request" coming from if not through CGI?
>
> I understand it as the script is doing a series of HTTP client requests
> and does some checks and stores some results to a database
>
> in that case it is not a question of database deadlocks the original
> post gave me the oimpression of , unless multiple parallel requests
> are being made, in which case file locking on the database needs to
> be done.
>
> To TF:
> I suggest you just do more debugging, such as logging to a file
> extensively, store on disk last input file, and so on.
> then when lockup happens, tail the log file to see where in the
> script you where, look at the last input and so on.
>
> then you might feed your script the last stored input again, to see if
> it is the data that does it. I am sure you have better ideas than us
> on how to debug your program, but the main rule is to strip away
> everything that is not needed to exhibit your problem, until what
> is left is so little that it becomes obvious.
>
> gnari
>
>
I've been basically doing this for two weeks, but it takes a whole day to
get to this point and the data from the last request and last stored plce
isn't helping much.
Once I kill the process, the dbm is screwed so I can't really see anything.
All it says is, can't find the end (closing quoute) of data entry or
something like this, MLDBM error.
However, I think that is the result of killing the process while it had the
db open.
I can add more logging, but the logfile is liable to fill the disk before
the error occurs.
>
------------------------------
Date: Sat, 6 Mar 2004 17:20:07 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: regexp
Message-Id: <slrnc4kn57.j83.tadmc@magna.augustmail.com>
kums <bckumari@yahoo.com> wrote:
> $text="hello";
> if($text=~/el/)
> {
> print $&;
> }
>
> how to delete the contents of '$&'?
$text =~ /^/;
If, on the other hand, you wanted to do something else, then
perhaps you should have asked how to do something else...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 6 Mar 2004 16:46:58 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: REQ: Perl 5.8.3 on OpenBSD
Message-Id: <c2cva2$1du$3@wisteria.csv.warwick.ac.uk>
"Newsgroup User" <none@given.com> wrote:
>
> -----BEGIN xxx SIGNED MESSAGE-----
What is the point of signing a message when you don't even give your
real name???
> I am running OpenBSD 3.4 and this is the optput from the compilation
> process:
>
<snip the WHOLE of Configure>
>
> cc -Wl,-E -L/usr/local/lib -o miniperl miniperlmain.o opmini.o
> libperl.a -lbind -lm -lutil -lc
> ./miniperl -w -Ilib -MExporter -e '<?>' || make minitest
> ./miniperl:/usr/lib/libc.so.30.1: /usr/local/lib/libbind.so.1.0 :
> WARNING: symbol(__p_class_syms) size mismatch, relink your program
You really don't need to include that much output. Where I snipped to is
quite sufficient.
It looks to me like /usr/local/lib/libbind.so.1.0 is not compatible with
your libc: where does it come from?
Ben
--
The cosmos, at best, is like a rubbish heap scattered at random.
- Heraclitus
ben@morrow.me.uk
------------------------------
Date: Sat, 06 Mar 2004 19:17:56 GMT
From: "Jeffrey A. LaPointe" <jefflapointe@sbcglobal.net>
Subject: Re: REQ: Perl 5.8.3 on OpenBSD
Message-Id: <Etp2c.9429$t16.5743227@newssvr28.news.prodigy.com>
It looks to me that the file inquestion came from the standard
libbind-9.2.2.tgz that is distributed with OpenBSD 3.4 . Maybe I have
added my lib packages in the wrong order and an older or incorrect
version has overwritten the proper libbind.so?
I must admit that I am new to the Perl and BSD environments, and
maybe I should be asking other questions that I do not know before
moving on to subjects such as this?
This time, my post should be corrected to reflect my name
> > cc -Wl,-E -L/usr/local/lib -o miniperl miniperlmain.o opmini.o
> > libperl.a -lbind -lm -lutil -lc
> > ./miniperl -w -Ilib -MExporter -e '<?>' || make minitest
> > ./miniperl:/usr/lib/libc.so.30.1: /usr/local/lib/libbind.so.1.0 :
> > WARNING: symbol(__p_class_syms) size mismatch, relink your
> > program
>
> You really don't need to include that much output. Where I snipped
> to is quite sufficient.
>
> It looks to me like /usr/local/lib/libbind.so.1.0 is not compatible
> with your libc: where does it come from?
>
> Ben
>
> --
> The cosmos, at best, is like a rubbish heap scattered at random.
> -
> Heraclitus
> ben@morrow.me.uk
------------------------------
Date: Sat, 6 Mar 2004 21:54:56 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: REQ: Perl 5.8.3 on OpenBSD
Message-Id: <c2dhbg$cb1$1@wisteria.csv.warwick.ac.uk>
[quoting fixed]
"Jeffrey A. LaPointe" <jefflapointe@sbcglobal.net> wrote:
> > > cc -Wl,-E -L/usr/local/lib -o miniperl miniperlmain.o opmini.o
> > > libperl.a -lbind -lm -lutil -lc
> > > ./miniperl -w -Ilib -MExporter -e '<?>' || make minitest
> > > ./miniperl:/usr/lib/libc.so.30.1: /usr/local/lib/libbind.so.1.0 :
> > > WARNING: symbol(__p_class_syms) size mismatch, relink your
> > > program
> >
> > You really don't need to include that much output. Where I snipped
> > to is quite sufficient.
> >
> > It looks to me like /usr/local/lib/libbind.so.1.0 is not compatible
> > with your libc: where does it come from?
>
> It looks to me that the file inquestion came from the standard
> libbind-9.2.2.tgz that is distributed with OpenBSD 3.4 . Maybe I have
> added my lib packages in the wrong order and an older or incorrect
> version has overwritten the proper libbind.so?
Hmmm, I don't know. I would be somwhat surpised if a 'system' library
was in /usr/local/lib, but then I don't know much about OpenBSD. Can you
install perl using the package manglement system (ports?) rather than by
hand? Otherwise, I think you'd be better off in some OpenBSD group or
mailing-list.
> This time, my post should be corrected to reflect my name
Yup, now learn to quote properly: i.e., put your replies underneath what
you are replying to.
Ben
--
Although few may originate a policy, we are all able to judge it.
- Pericles of Athens, c.430 B.C.
ben@morrow.me.uk
------------------------------
Date: Sat, 6 Mar 2004 18:41:21 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: serializing access to a resource in my mod_perl PerlHandler
Message-Id: <c2d5uf$1br$1@news.simnet.is>
"John Kelly" <john_kelly@uk.ibm.com> wrote in message
news:c256fbe4.0403060027.323aa5f5@posting.google.com...
> a mod_perl script i wrote quite some time ago has recently had
> increased "traffic". this has shown up a problem (i think) with
> serialization
> of resource in the "back-end" system that my mod_perl routine provides
> a wrapper for.
> In the short-term, while i'm investigating the problem i'd like
> quickly to modify something so all requests through the PerlHandler
> which processes the content are serialized.
> So, is there a configuration directive which can do this without
> modification to the script itself ?
the only directives I can think of that does that is the Apache
max number of connections directive and the max requests per client
directive (can't be bothered to look them up). set them to 1
this, of course will dramatically reduce performance of the web server
overall, but might allow you to tst if the problems disappear.
if that works, and you *really* want to avoid changing your script,
you might run another instance of Apache with these settings and
redirect requests to your script to that instance, say with mod_rewrite.
on the other hand, it should be relatively easy to implement some sort
of locking to serialize the requests, either with lockfiles or with
the Apache notes. to minimize modification of script, create a module
to do it, or maybe a nother wrapper layer.
gnari
------------------------------
Date: Sat, 6 Mar 2004 17:46:57 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Slow Sorting
Message-Id: <slrnc4konh.j83.tadmc@magna.augustmail.com>
$_@_.%_ <$_@_.%_> wrote:
>>$_@_.%_ wrote:
>>
>>[aside: Who said the rest? Are you cutting the attributions out yourself,
>>or are you simply using an incompetent news client?]
[aside: Who said the rest yet again?
Please provide an attribution when you quote someone.
]
>>: ><$_@_.%_> wrote in message
>>: >news:YFN1c.27102$6c5.15055@nwrdny01.gnilink.net...
>>: >
>>: >> Changing this:
>>: >> #foreach my $k (sort {$file{$b}[$col] cmp $file{$a}[$col]}
>>: >> # keys %file)
>>: >> #{
>>: >>
>>: >> To this:
>>: >> my @y = sort {$file{$b}[$col] cmp $file{$a}[$col]} keys %file;
>>: >> foreach my $k (@y) {
>>: >>
>>: >> Has really improved the speed of thw whole process.
>>: >> I suppose the extra time the sort was adding each time through
^^^^^^^^^
>>: >> the 'foreach' loop.. was enough to trigger $mw->update to frequently.
>>: due to the fact that the sort time is eliminated each time through the loop.
>>
>>That's a bizarre conclusion. The sort has to complete before the foreach
>>can have a list to iterate across. There is no resorting between
>>iterations.
> shrug... stfu..
^^
^^
Does that mean what I think it means?
> your words are totally useless.
Just because you do not understand them does not make them useless.
If you don't understand them, say so and maybe you will learn something.
You made a supposition. Some (unnamed) person pointed out that
your supposition was incorrect.
It was not useless, because now you know that you have not yet
correctly identified where the purported speed-up came from...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 6 Mar 2004 16:38:57 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: socket communication / callback
Message-Id: <c2cur1$1du$1@wisteria.csv.warwick.ac.uk>
Hannes <hanRnes.EkrueMger@OuibkV.ac.Eat> wrote:
> I'm wondering if it's possible to use sockets for the folloing purpose:
> A running process acts as a kind of server, sometimes it receives some data.
> The receiving should trigger some functions (some display update based on
> the new values received). While waiting, the process should be responsive
> to local user-interactions.
>
> I'm new to networking/socket programming and don't know how to implement
> this in a way that the receiving of data triggers some sort of callback and
> waiting for the receiving of the data without beeing "locked"
The best way is to put the sockets into non-blocking mode and use an
event loop. If you are doing the display using Tk or Gtk then these
toolkits provide an event loop already; if not then there are systems on
CPAN such as POE and stem that provide pre-packaged event loops which
you may find helpful.
Ben
--
It will be seen that the Erwhonians are a meek and long-suffering people,
easily led by the nose, and quick to offer up common sense at the shrine of
logic, when a philosopher convinces them that their institutions are not based
on the strictest morality. [Samuel Butler, paraphrased] ben@morrow.me.uk
------------------------------
Date: Sat, 6 Mar 2004 16:41:09 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: triggering callback from "outside"
Message-Id: <c2cuv5$1du$2@wisteria.csv.warwick.ac.uk>
Hannes <hanRnes.EkrueMger@OuibkV.ac.Eat> wrote:
> does anybody know if it is possible to trigger a callback from the "outside"
> (another process).
> The only method I know of, are (unix) signals, which won't work for me
> (since signal handling is delayed in Perl/Tk MainLoop, and won't work on
> win32 platforms).
It depends on what the receiving process is waiting for... you can use
sockets (probably best for portablility), fifos... read perldoc perlipc
for some idea of the possible mechanisms.
Ben
--
Musica Dei donum optimi, trahit homines, trahit deos. |
Musica truces molit animos, tristesque mentes erigit. | ben@morrow.me.uk
Musica vel ipsas arbores et horridas movet feras. |
------------------------------
Date: 06 Mar 2004 23:35:43 GMT
From: ctcgag@hotmail.com
Subject: Re: triggering callback from "outside"
Message-Id: <20040306183543.829$9G@newsreader.com>
Hannes <hanRnes.EkrueMger@OuibkV.ac.Eat> wrote:
> Hi,
>
> does anybody know if it is possible to trigger a callback from the
> "outside" (another process).
Isn't the point of a callback that the outside process decides when *it*
wants to trigger it? If you want to tell the outside process what to do,
isn't that just an ordinary call?
Maybe I don't understand the question...
> The only method I know of, are (unix) signals, which won't work for me
> (since signal handling is delayed in Perl/Tk MainLoop, and won't work on
> win32 platforms).
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 6 Mar 2004 17:23:25 -0800
From: uffesterner@spamhole.com (Rex Gustavus Adolphus)
Subject: Re: What with this open file descriptor/"Read on closed filehandle " stuff?
Message-Id: <c70a85ff.0403061723.39c74876@posting.google.com>
Paul Lalli <ittyspam@yahoo.com> wrote in message news:<20040305100846.Y27834@dishwasher.cs.rpi.edu>...
> On Fri, 5 Mar 2004, Rex Gustavus Adolphus wrote:
>
> > OK.
> > A related question, is it in any way inefficient to redeclare
> > variables,
> > as in ex 2 below:
> > ex 1:
> > my $foo;
> > while ($this_is_true) {
> > $foo = 0;
> > ...
> > # do fancy stuff
> > ...
> > $foo = $something;
> > }
> >
> > ex 2:
> > while ($this_is_true) {
> > my $foo = 0;
> > ...
> > # do fancy stuff
> > ...
> > $foo = $something;
> > }
>
> Efficiency isn't the issue here. These two programs are doing something
> different. The first one is declaring $foo's scope to be the whole file;
> the second one's scope is only within the while loop.
<snip>
> Make sure you know what you're telling your script to do before you worry
> about how efficient it is.
Well, I'm thinking of the efficiency.
Thanks for your concern, but I already know the different scopes for
$foo in the two examples, believe me, I would not try to use $foo
outside the while loop in my second example.
(I always "use strict" by the way.)
I asked, because I was recommended earlier in this thread
to put variables in the smallest possible scope,
and I do that in the sense, that I avoid using global variables,
but I tend to declare variables used in loops (while, for) before the
loop starts,
like in my first example (even if they are not used outside the loop)
and that's because I have this feeling that it's a little bit
inefficient
to do it like in my second example.
/RGA
------------------------------
Date: 6 Mar 2004 17:37:00 -0800
From: uffesterner@spamhole.com (Rex Gustavus Adolphus)
Subject: Re: What with this open file descriptor/"Read on closed filehandle " stuff?
Message-Id: <c70a85ff.0403061737.22cdf981@posting.google.com>
Ben Morrow <usenet@morrow.me.uk> wrote
>
> > The second quote seems to contradict the first partly.
>
> Yesss.... the first is right, though. The two forms have different
> semantics.
>
It seems to me, the second quote needs to be fixed til next version then.
I think I have had that "& is optional" in the back of my head somewhere
>
> This is because you don't understand prototypes :). If you want to, read
> the section on prototypes until you understand them; in the meanwhile,
> suffice it to say that calling a sub with a prototype with & causes its
> arguments to be parsed in a different way, and that the author of the
> sub will not have been expecting this. Thus, anything might happen: you
> should be sure you know what the effects will be before you do it. It
> says somewhere in perlsub that this effect is left in as a way of
> allowing experts to cheat if they need to: so yes, TMTOWTDI, but they do
> different things :).
>
> Ben
Ben, I think I'll stop using &sub()-calls now.
I think it looks rather ugly anyway...
Thanks for your patience!
/RGA
------------------------------
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 6228
***************************************