[18114] in Perl-Users-Digest
Perl-Users Digest, Issue: 274 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 12 14:07:05 2001
Date: Mon, 12 Feb 2001 11:05:50 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <982004749-v10-i274@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 12 Feb 2001 Volume: 10 Number: 274
Today's topics:
Re: A Question on OLE and EXCEL- help please <revjack@revjack.net>
complex... <snef@soneramail.nl>
Re: Directory listings in a table <joe+usenet@sunstarsys.com>
directory structure <hafner-usenet@ze.tu-muenchen.de>
Re: directory structure <godzilla@stomp.stomp.tokyo>
Re: directory structure (Abigail)
Re: directory structure (Ben Okopnik)
double byte perl dweisinger@my-deja.com
Re: double byte perl <julien.quint@imag.fr>
Re: flock() strategy for Win95? - eval() etc <godzilla@stomp.stomp.tokyo>
Re: flock() strategy for Win95? - eval() etc <mkruse@netexpress.net>
Re: Food for guru's: read/modify/write works under Linu (Abigail)
Re: How to send HTML email from Perl using CGI <ryanc@nci1.net>
Re: Net::FTP - incomplete file transfer problem <burgerNO@SPAMpmel.noaa.gov>
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: Newbie here please help! Permission errors while cr mexicanmeatballs@my-deja.com
Perl DBI - Can't call method "prepare" on an undefined <jhalbrook@bjcmail.carenet.org>
Re: Perl DBI - Can't call method "prepare" on an undef <tore@extend.no>
Re: postgres perl problem <peter@localshop.com.au>
Re: Re: A Question on OLE and EXCEL- help please hgonzalez@mindspring.com
Re: sort of about sort (Greg Bacon)
Re: sort of about sort (Randal L. Schwartz)
Re: Sorting <jdf@pobox.com>
Re: Sorting <josefiller@lucent.com>
Re: Specifying the length of regular expression <mischief@velma.motion.net>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: TCP server <Jerome.Abela@free.fr>
What makes perl throw 'Out of memory!' errors? zirconx@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Feb 2001 17:56:23 GMT
From: revjack <revjack@revjack.net>
Subject: Re: A Question on OLE and EXCEL- help please
Message-Id: <969847$iej$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
hgonzalez@mindspring.com wrote:
: test
No. No. Not again, Hector. Remember what happened last
time. Do not do this again.
--
___________________
revjack@revjack.net
------------------------------
Date: Mon, 12 Feb 2001 19:53:03 +0100
From: snef <snef@soneramail.nl>
Subject: complex...
Message-Id: <MPG.14f24f749373a72598970d@news.soneraplaza.nl>
Hi.
I want to get data out of a database (i can do that ;)), and display it.
Ok for templates and all. No problem.
The records in the database contain a date, a phonenumber and a service.
Now I want to select these fields and show them per year/month.
So service X had in November (11) 2000 20 phonenumbers,
service X had in December (12) 2000 12 phonenumbers,
Y Nov (11) 2000 2 phonenumbers......
and so on.
What is a good solution? for each service a retrieval from the database
of make it in a SQL-statement?
(When i read it back,...i hope you'll understand me!)
Snef
------------------------------
Date: 12 Feb 2001 12:24:20 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Directory listings in a table
Message-Id: <m3r913lsqj.fsf@mumonkan.sunstarsys.com>
Paul <schallerp@hotmail.com> writes:
> I'm looking for a script that I can use that will display a directory
> contents in a table in order of the file dates.
#!/usr/bin/perl -w
use strict;
use CGI ":standard";
$_ = "$ARGV[0] by date\n";
print table( {-border=>0},
caption($_),
Tr ( th($_) ),
map { Tr td($_) } `ls -ta $ARGV[0]` );
__END__
You can use this one as much as you like.
Joe Schaefer
--
"There are three classes of intellects: one which comprehends by itself;
another which appreciates what others comprehend; and a third which neither
comprehends by itself nor by the showing of others; the first is the most
excellent, the second is good, the third is useless."
--Nicolo Machiavelli
------------------------------
Date: 12 Feb 2001 18:07:46 +0100
From: Walter Hafner <hafner-usenet@ze.tu-muenchen.de>
Subject: directory structure
Message-Id: <srj7l2vomn1.fsf@w3projns.ze.tu-muenchen.de>
Hello,
I need to access a squid-like directory structure in round-robin.
If I have directories "/aa/" to /zz/, can anyone give me a convenient
way to access them? aa, ab, ... zz, aa, ab, ...
I know how to do it with substrings etc. I just wanted a more elegant
solution. :-)
Thanks
-Walter
------------------------------
Date: Mon, 12 Feb 2001 09:18:44 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: directory structure
Message-Id: <3A881AF4.9DA0392B@stomp.stomp.tokyo>
Walter Hafner wrote:
> I need to access a squid-like directory structure in round-robin.
> If I have directories "/aa/" to /zz/, can anyone give me a convenient
> way to access them? aa, ab, ... zz, aa, ab, ...
> I know how to do it with substrings etc. I just wanted a more elegant
> solution. :-)
How could a person provide a more eloquent solution
without a basis of comparison? This is, how will a
person compare a solution to your solution without
knowing what is your solution? Your solution may
already be the best solution. Who knows?
Godzilla!
------------------------------
Date: 12 Feb 2001 17:28:19 GMT
From: abigail@foad.org (Abigail)
Subject: Re: directory structure
Message-Id: <slrn98g79j.hhu.abigail@tsathoggua.rlyeh.net>
Walter Hafner (hafner-usenet@ze.tu-muenchen.de) wrote on MMDCCXXII
September MCMXCIII in <URL:news:srj7l2vomn1.fsf@w3projns.ze.tu-muenchen.de>:
// Hello,
//
// I need to access a squid-like directory structure in round-robin.
// If I have directories "/aa/" to /zz/, can anyone give me a convenient
// way to access them? aa, ab, ... zz, aa, ab, ...
//
// I know how to do it with substrings etc. I just wanted a more elegant
// solution. :-)
my @foo = ('aa' .. 'zz');
my $i = 0;
while (1) {print "/$foo[($i+=1)%=@foo]/\n"}
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: 12 Feb 2001 17:55:09 GMT
From: ben-fuzzybear@geocities.com (Ben Okopnik)
Subject: Re: directory structure
Message-Id: <slrn98g94e.jcj.ben-fuzzybear@Odin.Thor>
The ancient archives of 12 Feb 2001 18:07:46 +0100 showed
Walter Hafner of comp.lang.perl.misc speaking thus:
>Hello,
>
>I need to access a squid-like directory structure in round-robin.
>If I have directories "/aa/" to /zz/, can anyone give me a convenient
>way to access them? aa, ab, ... zz, aa, ab, ...
>
>I know how to do it with substrings etc. I just wanted a more elegant
>solution. :-)
I'm not exactly sure of what you're saying here, especially with the
repetition of the list, but here's an easy way to iterate over the list
itself:
$prefix = '/path/to/parent/dir';
foreach $dir ( 'aa' .. 'zz' ) {
chdir "$prefix/$dir\n" or die "Unable to cd: $!";
}
See "Range Operators" in the "perlop" manpage for more info.
Ben Okopnik
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"Don't be ashamed to say what you are not ashamed to think."
-- Montaigne
------------------------------
Date: Mon, 12 Feb 2001 16:02:24 GMT
From: dweisinger@my-deja.com
Subject: double byte perl
Message-Id: <9691e9$70l$1@nnrp1.deja.com>
Is there a Japanese version of perl?
Are there extensions to handle double byte, especially for regular
expression handling?
Thanks
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 12 Feb 2001 19:31:58 +0100
From: Julien Quint <julien.quint@imag.fr>
Subject: Re: double byte perl
Message-Id: <khv3ddjrbvl.fsf@imag.fr>
dweisinger@my-deja.com writes:
> Is there a Japanese version of perl?
> Are there extensions to handle double byte, especially for regular
> expression handling?
To my knowledge there is no "double-byte" version of Perl. I would suggest
the book "CJKV Information Processing" by Ken Lunde, published by O'Reilly,
1999. The Annex W (!) is dedicated to Perl.
The new support for UTF-8 might improve things, I haven't tried it yet.
--
Julien
------------------------------
Date: Mon, 12 Feb 2001 08:40:53 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: flock() strategy for Win95? - eval() etc
Message-Id: <3A881215.FEA5B26B@stomp.stomp.tokyo>
Matt Kruse wrote:
> Godzilla! wrote:
> > Traditional file lock is not supported on Win 9.x systems.
> I knew this ;)
Then why are you trying to use file lock under Win9.x?
This is exceptionally illogical.
> > Have a look at this page for an answer:
> > http://language.perl.com/newdocs/pod/perlopentut.html#File_Locking
> I'm not sure how this helps. It doesn't mention win9x limitations of flock,
> and it uses flock in every example without checking for failure. So
> basically, it will appear to work on win9x (ie, it won't fail) while in fact
> it doesn't do any locking. This is what I'm trying to avoid.
You asked for methodology to output error messages
related to file lock. This page presents excellent
examples from which you may learn.
My presumption is you haven't realized yet, for many
applications, there is no reason to use file lock
under Win9.x systems, especially if you change a
file's properties to "system" or change a file's
extension to ".dll" to kick in denial of access
when a file is already opened by an application
and another application tries to modify this file.
Also appears you have not yet realized you can
temporarily change a Win9.x file's properties
to "read only" or "hidden" to emulate file lock
under similar circustances.
However, you are trying to use file lock under
Win9.x while knowing it doesn't work under
Win9.x indicating you may face some challenges
in thinking.
Godzilla!
------------------------------
Date: Mon, 12 Feb 2001 12:33:49 -0600
From: "Matt Kruse" <mkruse@netexpress.net>
Subject: Re: flock() strategy for Win95? - eval() etc
Message-Id: <3a882bf8$0$21436@wodc7nh0.news.uu.net>
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> > > Traditional file lock is not supported on Win 9.x systems.
> > I knew this ;)
> Then why are you trying to use file lock under Win9.x?
> This is exceptionally illogical.
No, it's not. You're missing the point.
I'm writing a script that may be run in many different environments. I need
file locking.
If the environment being run in doesn't support file locking (Win9x) then I
need to use a different method or at the very least tell the user that their
data may be corrupted when running on this OS.
That, to me, seems perfectly logical.
> You asked for methodology to output error messages
> related to file lock. This page presents excellent
> examples from which you may learn.
I believe you mis-understood the question, because that is not what I asked.
> My presumption is you haven't realized yet, for many
> applications, there is no reason to use file lock
> under Win9.x systems...
What you haven't yet realized is that these solutions may work specifically
for Win95, but are not portable to other systems.
And you're ignoring the bigger question of knowing whether flock() is going
to function at all. Since it doesn't cause any error messages in Win95, the
question is how to detect when the OS doesn't support it properly.
> ... indicating you may face some challenges in thinking.
I appreciate the hostile attitude, but I think it is unwarranted considering
you aren't even addressing my actual questions.
Matt Kruse
http://www.mattkruse.com/
------------------------------
Date: 12 Feb 2001 16:20:31 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Food for guru's: read/modify/write works under Linux, not under Solaris. Please help!
Message-Id: <slrn98g3af.hhu.abigail@tsathoggua.rlyeh.net>
Randal L. Schwartz (merlyn@stonehenge.com) wrote on MMDCCXXII September
MCMXCIII in <URL:news:m1bss89cn0.fsf@halfdome.holdit.com>:
'' >>>>> "Abigail" == Abigail <abigail@foad.org> writes:
''
'' Abigail> [] select ((select (FILE), $| = 0) [0]); # Autoflush off
''
'' Abigail> This is highly obscure and smells like carg-cult. Could you
'' Abigail> also explain what it does, and why this is better than using
'' Abigail> a few short lines?
''
'' I find it amusing that Abigail is calling the nested-select device
'' which I created in 1989 "carg[o]-cult". :)
I know what it does, and where it comes from. I've my doubt the person
putting this in his code does - he just seems to cut-and-paste something
in his code and it just seems to work.
'' Perhaps in the fact that it's being used as "magick" makes it so, but
'' it's a reasonably compact solution to a common problem.
As for compactness, the idiom from the documentation:
$old = select FILE; $| = 0; select $old;
is just three characters more than
select ((select (FILE), $| = 0) [0]);
Creations from well-known Perlers are not immune to become cargo-cult.
In fact, they might be more prone. ("Look! It's made by foo! It's got
to have some potential!")
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
------------------------------
Date: Sun, 11 Feb 2001 08:21:00 -0500
From: "Ryan Carrier" <ryanc@nci1.net>
Subject: Re: How to send HTML email from Perl using CGI
Message-Id: <9663dj$bsh$1@taliesin.netcom.net.uk>
Try the Net::SMTP module (part of the libnet dist)
"Mark la mar" <whitevanman@btinternetREMOVE.com> wrote in message
news:tdeh6.29561$Vd5.120507@news11-gui.server.ntli.net...
> Hi,
>
> Can somebody please help me with this one. I`m wanting to senda small
email
> as HTML (just like Outlook does) using sendmail. I feel that sendmail
isn`t
> helping me out here and wonder what else to try.
> As you can probably tell, I`m not very experienced with Perl, but have
> written a few successful scripts.
>
> Thanks for your time.
>
>
------------------------------
Date: Mon, 12 Feb 2001 09:54:36 -0800
From: Eugene Burger <burgerNO@SPAMpmel.noaa.gov>
Subject: Re: Net::FTP - incomplete file transfer problem
Message-Id: <3A88235C.9284CF6C@SPAMpmel.noaa.gov>
Hi Jonathan,
The transfer stops within 20 seconds after the connection has been
established. I did set a different timeout value, and this made no
difference. Looking at the debug information, I see the transfer is
aborted ("Net::FTP=GLOB(0x1402af168)<<< 426 Transfer aborted. Data
connection closed.").
Any advise?
I will continue hacking at this and post any solution(s) I find.
Eugene
Jonathan Feinberg wrote:
> Eugene Burger <eburger@my-deja.com> writes:
>
> > I am using the Net::FTP module for automate file transfers between
> > machines on either side of the (US) coast. When I transfer files
> > using put, only about 25% of the files are transfered. I have this
> > problem with both binary and ascii files. The script works perfectly
> > between machines where the connection speed is higher - I only have
> > this problem when the connection speed drops down a bit.
>
> Have you adjusted the timeout option in the Net::Ftp cpnstructor?
>
> --
> Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
> http://pobox.com/~jdf
------------------------------
Date: Mon, 12 Feb 2001 16:42:44 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <t8g4k47otit4bc@corp.supernews.com>
Following is a summary of articles from new posters spanning a 7 day
period, beginning at 05 Feb 2001 16:40:54 GMT and ending at
12 Feb 2001 15:49:02 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2001 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 178 (40.8% of all posters)
Articles: 311 (22.7% of all articles)
Volume generated: 533.9 kb (20.8% of total volume)
- headers: 243.7 kb (4,860 lines)
- bodies: 286.1 kb (9,954 lines)
- original: 197.5 kb (7,110 lines)
- signatures: 3.8 kb (91 lines)
Original Content Rating: 0.690
Averages
========
Posts per poster: 1.7
median: 1.0 post
mode: 1 post - 115 posters
s: 1.8 posts
Message size: 1757.8 bytes
- header: 802.5 bytes (15.6 lines)
- body: 941.9 bytes (32.0 lines)
- original: 650.2 bytes (22.9 lines)
- signature: 12.4 bytes (0.3 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
13 25.7 ( 9.8/ 15.9/ 7.2) aramis1631@my-deja.com
12 26.4 ( 10.1/ 16.3/ 10.3) "Jonas Nilsson" <jonni@ifm.liu.se>
7 9.9 ( 5.5/ 4.4/ 1.5) "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
6 7.6 ( 4.6/ 3.0/ 2.5) dave_vb@my-deja.com
6 20.1 ( 5.6/ 14.5/ 1.1) Terrence Monroe Brannon <terrence.brannon@oracle.com>
6 9.0 ( 5.8/ 2.9/ 2.1) Jean-Louis Leroy <jll63@easynet.be>
5 7.4 ( 3.7/ 3.7/ 2.9) kumar22@my-deja.com
5 9.5 ( 3.2/ 6.3/ 5.9) "Jason from The Workshop" <jason@cyborgworkshop.com>
5 9.8 ( 4.3/ 5.2/ 4.1) Bruce Ingalls <bingalls@panix.com>
5 7.0 ( 4.3/ 2.7/ 1.8) "Thomas Schulz" <dk_sz@hotmail.com>
These posters accounted for 5.1% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
26.4 ( 10.1/ 16.3/ 10.3) 12 "Jonas Nilsson" <jonni@ifm.liu.se>
25.7 ( 9.8/ 15.9/ 7.2) 13 aramis1631@my-deja.com
20.1 ( 5.6/ 14.5/ 1.1) 6 Terrence Monroe Brannon <terrence.brannon@oracle.com>
10.8 ( 3.3/ 7.5/ 4.1) 3 "Jeffry A. Nokes" <jeff_nokes@yahoo.com>
10.4 ( 3.2/ 7.2/ 6.4) 4 "Phil Shean" <philip.shean@uwe.ac.uk>
9.9 ( 5.5/ 4.4/ 1.5) 7 "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
9.8 ( 4.3/ 5.2/ 4.1) 5 Bruce Ingalls <bingalls@panix.com>
9.5 ( 3.2/ 6.3/ 5.9) 5 "Jason from The Workshop" <jason@cyborgworkshop.com>
9.0 ( 5.8/ 2.9/ 2.1) 6 Jean-Louis Leroy <jll63@easynet.be>
7.9 ( 2.6/ 5.3/ 1.2) 3 Jason Baumbach <baumbach@bellatlantic.net>
These posters accounted for 5.4% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 1.9 / 1.9) 3 bonjaa@my-deja.com
0.927 ( 5.9 / 6.3) 5 "Jason from The Workshop" <jason@cyborgworkshop.com>
0.915 ( 1.8 / 1.9) 3 hilljroberts@my-deja.com
0.880 ( 6.4 / 7.2) 4 "Phil Shean" <philip.shean@uwe.ac.uk>
0.848 ( 3.6 / 4.3) 3 Alexey Morozov <morozov@novosoft.ru>
0.845 ( 2.5 / 3.0) 6 dave_vb@my-deja.com
0.818 ( 2.2 / 2.7) 3 Keep it to Usenet please <idontreadthis56@hotmail.com>
0.813 ( 2.2 / 2.7) 4 bakor@my-deja.com
0.782 ( 4.1 / 5.2) 5 Bruce Ingalls <bingalls@panix.com>
0.775 ( 2.9 / 3.7) 5 kumar22@my-deja.com
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.673 ( 1.8 / 2.7) 5 "Thomas Schulz" <dk_sz@hotmail.com>
0.649 ( 0.9 / 1.4) 4 J.C.Posey <jcp@myrtle.ukc.ac.uk>
0.632 ( 10.3 / 16.3) 12 "Jonas Nilsson" <jonni@ifm.liu.se>
0.548 ( 4.1 / 7.5) 3 "Jeffry A. Nokes" <jeff_nokes@yahoo.com>
0.489 ( 1.0 / 2.0) 3 edis9@my-deja.com
0.451 ( 7.2 / 15.9) 13 aramis1631@my-deja.com
0.411 ( 2.0 / 4.8) 4 maheshasolkar@yahoo.com
0.330 ( 1.5 / 4.4) 7 "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
0.222 ( 1.2 / 5.3) 3 Jason Baumbach <baumbach@bellatlantic.net>
0.076 ( 1.1 / 14.5) 6 Terrence Monroe Brannon <terrence.brannon@oracle.com>
25 posters (14%) had at least three posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
65 alt.perl
17 comp.lang.misc
17 comp.lang.perl
13 comp.lang.perl.modules
6 alt.comp.perlcgi.freelance
6 comp.lang.fortran
3 comp.text.xml
1 comp.lang.perl.announce
1 comp.lang.tcl.announce
1 comp.os.linux.misc
Top 10 Crossposters
===================
Articles Address
-------- -------
3 "Patrick L. Olson" <patrickolson@qwest.net>
3 Jean-Luc Fontaine <jfontain@free.fr>
3 "Carmari" <caramari9@hotmail.com>
3 bonjaa@my-deja.com
3 "Jonas Nilsson" <jonni@ifm.liu.se>
2 "John W" <jwgws@hotZEROSPAMmail.com>
2 Michael Prager <Mike.Prager@noaa.gov>
2 Matthew Leonhardt <matthewl@uwm.edu>
2 Keep it to Usenet please <idontreadthis56@hotmail.com>
1 "Richard Brown" <anarch1st@yahoo.com>
------------------------------
Date: Mon, 12 Feb 2001 16:06:36 GMT
From: mexicanmeatballs@my-deja.com
Subject: Re: Newbie here please help! Permission errors while creating directories
Message-Id: <9691m4$7ch$1@nnrp1.deja.com>
In article <96786g$qk0$1@nnrp1.deja.com>,
Costin <tanase_costin@my-deja.com> wrote:
> In article <95shpr$9e0$1@nnrp1.deja.com>,
> hilljroberts@my-deja.com wrote:
> > In article <95sfit$7co$1@nnrp1.deja.com>,
> > tanase_costin@my-deja.com wrote:
>
> > as to answer one more question for me: Why does that work? I mean,
> how
> > do you get to the 16893 from 755?
By luck apparently... ;)
> How to convert in decimal, I really do not know! I guess I wrote at a
> certain moment o script to show the mode of my files and i simplly
took
> the output produced by perl for this kind of permission ( as this is
the
> only one I use).
Well...............
There's the maths way:-
0755 = 7*64 + 5*8 + 5 = 493
The perl way:-
print 0755
493
The '0' prefix indicates octal, thus 0755 != 755.
So, your original code was fine, but with $mode=0755; instead.
--
Jon
perl -e '$|=($_)=(pop);A:$_=~s/.(.)(.*)/\r$2$1/;print;
select pop,pop,pop,.10;goto A' ' iname.com JonBarker@'
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Mon, 12 Feb 2001 10:59:59 -0600
From: "Joe Halbrook" <jhalbrook@bjcmail.carenet.org>
Subject: Perl DBI - Can't call method "prepare" on an undefined value
Message-Id: <MHUh6.422542$w61.472118@dfw-read.news.verio.net>
Hello,
I am new to Perl DBI coding and had a simple question:
If I need to connect to mulitple tables in a database,
can I connect to the database once, then reset my $sth
handle in successive prepare methods to access the
tables.
I am getting the error:
Can't call method "execute" on an undefined value
on the 3rd line below:
&connect_db; # Connect to mySQL database if not already
$sql = qq{ SELECT blahblah FROM blahTable WHERE blahVar LIKE %blahh%" };
$sth->execute();
OR
Can't call method "prepare" on an undefined value
on the 2nd line below:
&connect_db; # Connect to mySQL database if not already
$sth = $dbh->prepare("SELECT blah FROM blahTable WHERE blahVar LIKE
'%blah%'");
$sth->execute();
My &connect_db subroutine is:
sub connect_db {
if ($connected eq '0') {
my $database_name = $database;
my $location = "localhost";
my $port_num = "3306";
# define the location of the sql server.
my $database = "DBI:mysql:$database_name:$location:$port_num";
my $db_user = "user";
my $db_password = "pswd";
# connect to the sql server.
my $dbh = DBI->connect($database,$db_user,$db_password,
{ RaiseError => 0, PrintError => 0}) or
log_DBI_error;
$connected = 1;
}
}
Would someone have any suggestions? Thank you.
Joe Halbrook
BJCHealthCare, Inc.
http://www.bjc.org
------------------------------
Date: Mon, 12 Feb 2001 19:48:22 +0100
From: Tore Aursand <tore@extend.no>
Subject: Re: Perl DBI - Can't call method "prepare" on an undefined value
Message-Id: <MPG.14f24e655438c00f9898a3@news.online.no>
In article <MHUh6.422542$w61.472118@dfw-read.news.verio.net>,
jhalbrook@bjcmail.carenet.org says...
> If I need to connect to mulitple tables in a database,
> can I connect to the database once, then reset my $sth
> handle in successive prepare methods to access the
> tables.
You don't connect to the tables in a database - you connect only to the
database itself.
> $sql = qq{ SELECT blahblah FROM blahTable WHERE blahVar LIKE %blahh%" };
> $sth->execute();
This is _very_ wrong. SQL statements should always (...) be like this;
my $sth = $dbh->prepare(...);
$sth->execute();
# Process the data here
$sth->finish();
When you connect (and disconnect to the database), you should do
something like this;
unless (defined $dbh) {
$dbh = DBI->connect(...);
unless (defined $dbh) {
# Something went wrong
}
}
This is the way I do it, 'cause it will keep the database connection in
memory when running mod_perl.
> sub connect_db {
>
> if ($connected eq '0') {
> my $dbh = DBI->connect(...);
> $connected = 1;
> }
>
> }
$dbh will in the example above only be visible inside the connect_db()
subroutine. The rest of the program will probably never 'see' it.
--
Tore Aursand - tore@extend.no - http://www.extend.no/~tore/
------------------------------
Date: Tue, 13 Feb 2001 04:05:57 +1100
From: Peter Scott <peter@localshop.com.au>
Subject: Re: postgres perl problem
Message-Id: <3A8817F4.1D5C892@localshop.com.au>
Joe Schaefer wrote:
> "Tony Dalbrekt" <to.da@spray.se> writes:
>
> > Can't locate pg.pm in @INC (@INC contains: /usr/lib/perl5/5.6.0/i386-linux
> > /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux
> > /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at
> > /home/toda/html//cgi-bin/test.cgi line 8.
> >
> > Why do I get this error message every time I try to connect to my postgres
> > database.
>
> That's perl's way of telling you that your script needs to load the
> pg.pm module, but perl can't find the file in it's search path (@INC)
> to load it. If you forgot to install the correct module, it's available
> on CPAN. A search for "postgres" at
>
> http://www.cpan.org
>
> pulled up lots of packages; be sure to get the one that corresponds to
> your script.
>
> HTH
>
> Joe Schaefer
> --
> #include <stdio.h> /* requires gcc and *nix
> use strict; system("cc -x c $0") and die $?; open C, "|a.out" or die $! . q*/
> main(){char s[32]; remove("a.out"); printf("%s/C hacker\n",fgets(s,32,stdin));
> return 0;}/*; print C "Just another Perl"; close C or die $?; #*/
try use Pg;
also make sure that you have the Postgres libraries and header files installed
before installing Pg.
Peter
"The point's the sharp bit at the end"
------------------------------
Date: 12 Feb 2001 17:26:38 GMT
From: hgonzalez@mindspring.com
Subject: Re: Re: A Question on OLE and EXCEL- help please
Message-Id: <2334-qx3@questionexchange.com>
test
------------------------------
Date: Mon, 12 Feb 2001 17:03:20 -0000
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: sort of about sort
Message-Id: <t8g5qoc28v5i2b@corp.supernews.com>
In article <3a8688c7.57b6$3c1@news.op.net>,
Mark Jason Dominus <mjd@plover.com> wrote:
: In article <960ltm$krd$1@bob.news.rcn.net>,
: Eric Bohlman <ebohlman@omsdev.com> wrote:
:
: >In this case, there really is, IMHO, justification for OMWTDI:
: >default sorts are significantly faster than sorts using a comparison
: >block
:
: Yes, but the Right Thing To Do is to recognize those sorts at compile
: time and optimize them. Greg Bacon contributed a patch some time ago
: to do precisely that; the optimization is in 5.6.0. [...]
Here I should mention that Hans Mulder did some considerable cleanup
and reworking to ready the patch for (I think) 5.6.0.
I wonder how much of a win it would be to have a special builtin
comparison for Schwartzian Transforms, e.g., $a->[0] <=> $b->[0]. Would
the invariant have to go in the 0th position? Joseph Hall pointed out
that it would be nice if there were an XS interface for providing one's
own quick comparisons.
Greg
------------------------------
Date: 12 Feb 2001 09:54:02 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: sort of about sort
Message-Id: <m1snlj9491.fsf@halfdome.holdit.com>
>>>>> "Greg" == Greg Bacon <gbacon@HiWAAY.net> writes:
Greg> I wonder how much of a win it would be to have a special builtin
Greg> comparison for Schwartzian Transforms, e.g., $a->[0] <=> $b->[0]. Would
Greg> the invariant have to go in the 0th position?
I try to always teach it that way, although I think the posting
which triggered the naming of the transform had the original data
in the [1] element, not [0].
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 12 Feb 2001 11:12:17 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Sorting
Message-Id: <7l2vev8e.fsf@pobox.com>
Karl-Jose Filler <josefiller@lucent.com> writes:
> for $i (1..100) {
> $l[$i]->{'X'} = $i;
> }
In this loop you're auto-vivifying $l[0], since you create array
elements higher than 0. Perhaps you meant to go from 0 to 99?
> for $i (sort({$b->{'X'} <=> $a->{'X'} } @l)) {
The first value in @l is undef. When you refer to $a->{X} you are,
in fact, referring to undef->{X}. You are, in essence, trying to
autovivify the "X" key of the anonymous hash referred to by undef,
which you cannot do.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Mon, 12 Feb 2001 17:21:00 +0100
From: Karl-Jose Filler <josefiller@lucent.com>
To: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Sorting
Message-Id: <3A880D6C.257AB570@lucent.com>
This is a multi-part message in MIME format.
--------------7B719488DCF4D60270B47C14
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Thanks a lot, that was my fault,
Now, it works ....
Jose
Jonathan Feinberg wrote:
> Karl-Jose Filler <josefiller@lucent.com> writes:
>
> > for $i (1..100) {
> > $l[$i]->{'X'} = $i;
> > }
>
> In this loop you're auto-vivifying $l[0], since you create array
> elements higher than 0. Perhaps you meant to go from 0 to 99?
>
> > for $i (sort({$b->{'X'} <=> $a->{'X'} } @l)) {
>
> The first value in @l is undef. When you refer to $a->{X} you are,
> in fact, referring to undef->{X}. You are, in essence, trying to
> autovivify the "X" key of the anonymous hash referred to by undef,
> which you cannot do.
>
> --
> Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
> http://pobox.com/~jdf
--------------7B719488DCF4D60270B47C14
Content-Type: text/x-vcard; charset=us-ascii;
name="josefiller.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Karl-Jose Filler
Content-Disposition: attachment;
filename="josefiller.vcf"
begin:vcard
n:Filler;Karl-Jose
tel;cell:+49-170-5627564
tel;work:+49-911-526-2870
x-mozilla-html:FALSE
org:Lucent Technologies;BSC DFS
adr:;;Thurn und Taxis Str. 10;Nuernberg;;90411;Germany
version:2.1
email;internet:josefiller@lucent.com
fn:Karl-José Filler
end:vcard
--------------7B719488DCF4D60270B47C14--
------------------------------
Date: Mon, 12 Feb 2001 17:05:13 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Specifying the length of regular expression
Message-Id: <t8g5u9aufmhv63@corp.supernews.com>
Ian Boreham <iboreham@my-deja.com> wrote:
> In article <3a835728.6a41$378@news.op.net>,
> mjd@plover.com (Mark Jason Dominus) wrote:
>> In article <95v3pv$fhp$1@nnrp1.deja.com>, <bonjaa@my-deja.com> wrote:
>> >How can I write a regular expression for the following:
>>
>> That is what we call the Wrong Question.
> In this case, probably, but not necessarily.
[snipped good counterexample that I imagine rarely happens]
> But I know what you mean.
> If you really need to do it with a single regex, try:
> ^(?=[ABC]{10,})A+B*C+$
> or some variation to taste.
A variation for my taste, please! Althought he above works, I
find using a lookahead at the beginnging of a regex a bit
awkward. I find it too specialized to use a character class for
something which to me looks like it could be for any type of
token stream. I also don't see where the OP said there could
be no leading or trailing characters/tokens (but that's an
easy part to fix if they are allowed).
/^A(?:A|B(?!A)|C(?!A|B)){9,}C$/
is a bit longer than
/^(?=[ABC]{10,})A+B*C+$/
and it does have more punctuation in it, but it seems
a bit clearer to me and much more general (in case we're
dealing with multi-character tokens with the same code).
On the other hand, since Ian's regex doesn't make as many
individual checks as mine, his is almost twice as fast. I
could learn to live with it for that. ;)
For length greater than 10, though, it really should be
/^(?=[ABC]{11,})A+B*C+$/ instead.
[snipped test code and its output]
Mine passes and fails the same matches as Ian's, even when
I added more tests (except i ran against Ian's with the 10
changed to an 11, and changed his fence test from 9 chars and
10 chars to 10 and 11). Mine's slower but more general. I
think I saw an answer to a very similar - if not the same -
question not long ago that works well, too.
Chris
--
Christopher E. Stith
Parking for people we like only. All other vehicles will be vandalized.
------------------------------
Date: Mon, 12 Feb 2001 16:42:39 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <t8g4jvfbq5k4b8@corp.supernews.com>
Following is a summary of articles spanning a 7 day period,
beginning at 05 Feb 2001 16:40:54 GMT and ending at
12 Feb 2001 15:49:02 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2001 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@(?:.*\.)?perl\.com
Totals
======
Posters: 436
Articles: 1372 (540 with cutlined signatures)
Threads: 383
Volume generated: 2563.3 kb
- headers: 1104.4 kb (21,784 lines)
- bodies: 1377.6 kb (45,356 lines)
- original: 891.3 kb (31,574 lines)
- signatures: 80.0 kb (1,687 lines)
Original Content Rating: 0.647
Averages
========
Posts per poster: 3.1
median: 1.0 post
mode: 1 post - 230 posters
s: 5.1 posts
Posts per thread: 3.6
median: 2 posts
mode: 1 post - 134 threads
s: 4.3 posts
Message size: 1913.2 bytes
- header: 824.3 bytes (15.9 lines)
- body: 1028.2 bytes (33.1 lines)
- original: 665.3 bytes (23.0 lines)
- signature: 59.7 bytes (1.2 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
41 106.5 ( 23.8/ 77.3/ 47.0) Chris Stith <mischief@velma.motion.net>
39 93.7 ( 35.3/ 57.9/ 39.5) "Godzilla!" <godzilla@stomp.stomp.tokyo>
38 77.4 ( 36.1/ 35.0/ 33.8) abigail@foad.org
28 118.2 ( 21.4/ 95.7/ 95.7) PerlFAQ Server <faq@denver.pm.org>
25 52.4 ( 20.4/ 27.0/ 16.2) Joe Schaefer <joe+usenet@sunstarsys.com>
23 37.0 ( 16.9/ 19.7/ 7.4) Garry Williams <garry@zvolve.com>
21 38.5 ( 15.5/ 22.1/ 11.2) Chris Fedde <cfedde@fedde.littleton.co.us>
21 34.7 ( 17.6/ 17.0/ 11.8) Bart Lateur <bart.lateur@skynet.be>
21 38.9 ( 21.9/ 14.0/ 8.4) tadmc@augustmail.com
21 44.8 ( 20.4/ 18.0/ 12.8) Mark Jason Dominus <mjd@plover.com>
These posters accounted for 20.3% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
118.2 ( 21.4/ 95.7/ 95.7) 28 PerlFAQ Server <faq@denver.pm.org>
106.5 ( 23.8/ 77.3/ 47.0) 41 Chris Stith <mischief@velma.motion.net>
93.7 ( 35.3/ 57.9/ 39.5) 39 "Godzilla!" <godzilla@stomp.stomp.tokyo>
77.4 ( 36.1/ 35.0/ 33.8) 38 abigail@foad.org
52.4 ( 20.4/ 27.0/ 16.2) 25 Joe Schaefer <joe+usenet@sunstarsys.com>
46.7 ( 18.1/ 24.6/ 13.5) 20 mgjv@tradingpost.com.au
44.8 ( 20.4/ 18.0/ 12.8) 21 Mark Jason Dominus <mjd@plover.com>
41.6 ( 16.7/ 19.2/ 7.0) 19 Uri Guttman <uri@sysarch.com>
38.9 ( 21.9/ 14.0/ 8.4) 21 tadmc@augustmail.com
38.5 ( 15.5/ 22.1/ 11.2) 21 Chris Fedde <cfedde@fedde.littleton.co.us>
These posters accounted for 25.7% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 95.7 / 95.7) 28 PerlFAQ Server <faq@denver.pm.org>
0.994 ( 6.6 / 6.7) 6 The WebDragon <nospam@nospam.com>
0.964 ( 33.8 / 35.0) 38 abigail@foad.org
0.927 ( 5.9 / 6.3) 5 "Jason from The Workshop" <jason@cyborgworkshop.com>
0.918 ( 5.3 / 5.7) 7 "John Lin" <johnlin@chttl.com.tw>
0.857 ( 2.4 / 2.9) 5 "Stephen Deken" <shutupsteve@aNwOdSaPnAgM.com>
0.845 ( 2.5 / 3.0) 6 dave_vb@my-deja.com
0.805 ( 2.4 / 3.0) 5 Peter L. Berghold <peter@uboat.berghold.net>
0.804 ( 3.2 / 3.9) 7 BUCK NAKED1 <dennis100@webtv.net>
0.782 ( 4.1 / 5.2) 5 Bruce Ingalls <bingalls@panix.com>
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.380 ( 1.5 / 4.0) 9 John Joseph Trammell <trammell@bayazid.hypersloth.net>
0.378 ( 4.2 / 11.1) 19 grauezellen@gibts.net
0.375 ( 7.4 / 19.7) 23 Garry Williams <garry@zvolve.com>
0.364 ( 7.0 / 19.2) 19 Uri Guttman <uri@sysarch.com>
0.345 ( 4.3 / 12.5) 7 "- = k o l i s k o = -" <kolisko@penguin.cz>
0.330 ( 1.5 / 4.4) 7 "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
0.315 ( 1.5 / 4.7) 8 "John W. Krahn" <krahnj@acm.org>
0.303 ( 4.5 / 14.7) 18 John Tutchings <ccx138@coventry.ac.uk>
0.280 ( 2.8 / 10.1) 9 bits101010@my-deja.com
0.076 ( 1.1 / 14.5) 6 Terrence Monroe Brannon <terrence.brannon@oracle.com>
70 posters (16%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
32 splitting a string on the / character
31 Need Help Checking IP Address Syntax w/ PERL?
23 Radical readdir suggestion
21 Is scalar a float, int or string?
19 Devel DProf and " dprofpp "
18 getting line number n of a file
17 This is driving me nuts and I need a guru
17 "Average of List of Numbers" by Abigail
17 Regular Expression Question
17 newbie - grep non-used uid from passwd
These threads accounted for 15.5% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
67.0 ( 27.2/ 35.5/ 21.6) 32 splitting a string on the / character
65.4 ( 21.0/ 41.1/ 21.9) 23 Radical readdir suggestion
54.8 ( 24.5/ 27.5/ 16.0) 31 Need Help Checking IP Address Syntax w/ PERL?
51.8 ( 16.6/ 34.8/ 24.5) 19 Devel DProf and " dprofpp "
39.3 ( 18.8/ 16.8/ 9.6) 21 Is scalar a float, int or string?
37.6 ( 14.2/ 22.1/ 9.3) 17 newbie - grep non-used uid from passwd
36.8 ( 12.3/ 24.3/ 19.9) 17 non repeating random numbers
34.4 ( 19.3/ 12.8/ 7.7) 17 This is driving me nuts and I need a guru
33.3 ( 12.5/ 19.3/ 12.0) 17 "Average of List of Numbers" by Abigail
33.0 ( 10.4/ 21.6/ 11.5) 14 Hashes
These threads accounted for 17.7% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.883 ( 6.5/ 7.3) 7 perl editor
0.879 ( 2.6/ 2.9) 6 undef ?
0.819 ( 19.9/ 24.3) 17 non repeating random numbers
0.777 ( 4.0/ 5.1) 6 Food for guru's: read/modify/write works under Linux, not under Solaris. Please help!
0.775 ( 9.5/ 12.3) 16 Fastest way of left-padding a number?
0.770 ( 10.9/ 14.2) 9 perlmail vs procmail
0.762 ( 2.3/ 3.0) 6 PLEASE HELP A NEWBIE
0.754 ( 7.7/ 10.2) 8 Pattern Extracting
0.745 ( 2.8/ 3.8) 5 flock unavailable on many platforms
0.741 ( 2.2/ 2.9) 5 Pattern Matching
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.469 ( 3.3 / 7.1) 6 Net::FTP error - timeout on put()
0.464 ( 4.5 / 9.8) 8 insertion sort algorithm
0.449 ( 6.2 / 13.8) 13 Modules/Constants.
0.441 ( 2.5 / 5.7) 5 Printing from "@_"
0.439 ( 1.3 / 3.0) 6 how to remove item in the array?
0.432 ( 2.2 / 5.2) 6 er, how?
0.421 ( 9.3 / 22.1) 17 newbie - grep non-used uid from passwd
0.395 ( 0.8 / 2.0) 6 Stream? Pipe? Socket?
0.379 ( 5.1 / 13.6) 12 Problem with regex and if/else expression
0.344 ( 3.3 / 9.5) 7 Sending email from Perl Script on NT
87 threads (22%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
65 alt.perl
17 comp.lang.misc
17 comp.lang.perl
13 comp.lang.perl.modules
6 alt.comp.perlcgi.freelance
6 comp.lang.fortran
3 comp.text.xml
1 comp.lang.perl.announce
1 comp.lang.tcl.announce
1 comp.os.linux.misc
Top 10 Crossposters
===================
Articles Address
-------- -------
12 Chris Stith <mischief@velma.motion.net>
5 grauezellen@gibts.net
5 Joe Smith <inwap@best.com>
4 Monte Phillips <montep@hal-pc.org>
4 Eli the Bearded <elijah@workspot.net>
3 "Carmari" <caramari9@hotmail.com>
3 "Patrick L. Olson" <patrickolson@qwest.net>
3 Jean-Luc Fontaine <jfontain@free.fr>
3 Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
3 "John Boy Walton" <johngros.NOSPAM@bigpond.net.au>
------------------------------
Date: Mon, 12 Feb 2001 17:19:49 GMT
From: Jerome Abela <Jerome.Abela@free.fr>
Subject: Re: TCP server
Message-Id: <3A881A3B.824745D0@free.fr>
Studio 51 writes:
> My little server may not get a new connection for some time, and
> if it gets the SIGHUP while it's waiting for accept() to return then it
> won't get a chance to check for the flag till it gets a new connection.
When your server receives a signal it handles, accept() returns with
error code EINTR. If it checks that flag just after accept(), your
server does have an opportunity to clean everything before exiting.
Jerome.
------------------------------
Date: Mon, 12 Feb 2001 17:48:24 GMT
From: zirconx@my-deja.com
Subject: What makes perl throw 'Out of memory!' errors?
Message-Id: <9697l9$ar8$1@nnrp1.deja.com>
I'm finding some strange problems when trying to select large text data
from a MS SQL 7 database server using the DBD-Sybase module. My script
is only a couple of lines long (included below). All I'm trying to do
right now is select a large text field (about 80k). When I
$dbh->execute() the statement, I get an "Out of memory!" error coming
from perl. The box has plenty of memory (at least 80k anyway!).
I should mention that this script works fine for selecting any amount of
data from any table/fields in my database except this large one (which
contains Base64()'d images if you want to know).
I'm running RedHat 6.2, perl 5.005_03, DBI 1.14, DTD-Sybase 0.91 (with
freetds 0.51).
Here is (most of) the script:
use DBI;
$dbh = DBI->connect("dbi:Sybase:server=dbdev;database=tlm", $user,
$pass);
$sth = $dbh->prepare("SELECT image,filename FROM image WHERE imageid =
21");
# it throws the error here, when I try to execute it
$sth->execute();
while ( @row = $sth->fetchrow_array ) {
print "Got one: $row[1]\n";
}
I also tried this on another text box, RedHat 5.2, perl 5.004_04, the
rest all the same. On this box I do not get an out of memory error, but
a segmentation fault/core dump when I try to call fetchrow_array.
Thanks for any help.
Ryan
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 274
**************************************