[6816] in Perl-Users-Digest
Perl-Users Digest, Issue: 441 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 6 17:17:34 1997
Date: Tue, 6 May 97 14:00:29 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 6 May 1997 Volume: 8 Number: 441
Today's topics:
Re: (Newbie alert!) How to have Perl PUSH browser to a <Jan.Krynicky@st.ms.mff.cuni.cz>
Re: > 2GB "file too large", AIX 4.2, perl 5.001, not "u (Bob Shair)
@INC Modification <trobison@erols.com>
Re: @INC Modification (A. Deckers)
bad name for good idea: comp.lang.perl.moderated (was R <merlyn@stonehenge.com>
CGI help! <lin.293@postbox.acs.ohio-state.edu>
Re: Comparing multi-line variables (Zachary Brown)
Current Version of Perl (Biglizec)
Re: Current Version of Perl (A. Deckers)
DANGER !! Search patters <shlomoa@iil.intel.com>
Re: DANGER !! Search patters (Tad McClellan)
Flushing pipes <jims@online-marketing.com>
Re: getting and derefencing in one go (M.J.T. Guy)
How to fit a Perl5 program to Perl4? (A linuxer)
Re: how to use a system-installed Perl w/locally downlo (Terrence M. Brannon)
Re: MacPerl5 on PB100 <neeri@iis.ee.ethz.ch>
Re: notice to antispammers <usenet-tag@qz.little-neck.ny.us>
Re: Pattern Match Question <dbenhur@egames.com>
Re: PERL & ADO - SQL INSERT slows after 100 Executions <e.nierop@tip.nl.nospam>
PERL EXTENTION - PLEASE HELP <shlomoa@iil.intel.com>
perl for dos studen04@htc.net
Re: perl for dos (A. Deckers)
Re: program for perl? (Kyzer)
Re: program for perl? (Michael J Gebis)
Re: program for perl? (Kyzer)
q: Can't figure out autoloading (Terrence M. Brannon)
Re: rational systems inc. annoying message in perl 5.00 (Raymond Chen)
Re: scalar holds compiled code (Tom Vaughan)
Re: Singles and doubles (David Alan Black)
slow script <brandon@physics.utexas.edu>
system () won't execute the called program. <anderson@necsys.gsfc.nasa.gov>
TIEARRAY Q <buzz@bear.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 06 May 1997 22:08:24 -0700
From: Jan Krynicky <Jan.Krynicky@st.ms.mff.cuni.cz>
To: Rich Andrews <andrewsr@bellatlantic.net>
Subject: Re: (Newbie alert!) How to have Perl PUSH browser to a web site
Message-Id: <33700E48.335B@st.ms.mff.cuni.cz>
Rich Andrews wrote:
>
> I've noticed several web sites that invoke a program with the end result
> being
> that by browser is at a new location (w/o weird codes as the URL).
>
> For example, how could I write a simple perl script that pushes the browser
> to www.yahoo.com?
>
> (W/o using browser tricks, etc.)
>
> THANKS IN ADVANCE!
> -Rich
#!/bin/sh
echo "Location: http://www.yahoo.com/"
echo
echo
# end of file
Hi, jenda
------------------------------
Date: 6 May 1997 20:25:52 GMT
From: rmshair@uiuc.edu (Bob Shair)
Subject: Re: > 2GB "file too large", AIX 4.2, perl 5.001, not "ulimit"
Message-Id: <5ko44g$qie@vixen.cso.uiuc.edu>
"Geoff Mottram" <minaret@sprynet.com> writes:
>Two gigabytes is the typical file size limit on a UNIX system. That's
>because it's the largest number you can hold in a signed 32 bit integer.
>Even if AIX can create larger files, Perl may not be able to manipulate
>them properly. Are you sure you can't break the files up a bit?
Would that we could! This client is growing so fast it's almost killed them!
--
Bob Shair Open Systems Consultant
1018 W. Springfield Avenue rmshair@uiuc.edu
Champaign, IL 61821 217/356-2684
< Not employed by or representing the University of Illinois >
------------------------------
Date: Tue, 06 May 1997 15:35:53 -0400
From: Terry Robison <trobison@erols.com>
Subject: @INC Modification
Message-Id: <336F8819.12AD@erols.com>
Does anyone know how to initialize @INC to point to a specific
directory? A little backround:
I have a system standard version of perl installed on my server (Version
5.001). I have acquired a CGI script that requires 5.002. The system
folks have installed V. 5.003 in another directory on the server. I have
changed the first line of the scripts to reflect the newer version path.
But I am still getting an error not locating the Oraperl module that is
referenced in a "use" statement. When I print the @INC array it has a
directory that is not located on our server, thus it is not finding the
library routines. How can I assure that the scripts can locate the perl
library?
I hope that I have provided enough information so that some perl guru
can give me a simple solution. I am new to perl but am trying to learn
it.
Thanks
Terry Robison
------------------------------
Date: 6 May 1997 20:45:44 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: @INC Modification
Message-Id: <slrn5mv63o.rok.I-hate-cyber-promo@news.rediris.es>
In comp.lang.perl.misc,
trobison@erols.com wrote:
>Does anyone know how to initialize @INC to point to a specific
>directory? A little backround:
No background required.
use lib '/your/lib/path';
It's all there in the docs if you look for it.
>I have a system standard version of perl installed on my server (Version
>5.001). I have acquired a CGI script that requires 5.002. The system
>folks have installed V. 5.003 in another directory on the server. I have
>changed the first line of the scripts to reflect the newer version path.
I presume YM the "#!/.../perl -w" line.
HTH,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
------------------------------
Date: 06 May 1997 09:41:10 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: g.simmons@elmshorn.netsurf.de (Geoff Simmons)
Subject: bad name for good idea: comp.lang.perl.moderated (was Re: Loosing clpm regulars (was Re: Perl auto-replier))
Message-Id: <8civ0wo8nt.fsf_-_@gadget.cscaper.com>
>>>>> "Geoff" == Geoff Simmons <g.simmons@elmshorn.netsurf.de> writes:
Geoff> In article <slrn5mguco.mfu.I-hate-cyber-promo@nessie.mcc.ac.uk>,
Geoff> I-hate-cyber-promo@man.ac.uk wrote:
>> As some of you know, I recently published a pre-RFD for some additional
>> (moderated) clp.* newsgroups.
>>
>> I would like to know what regular readers of clpm think about adding a
>> comp.lang.perl.moderated to the pre-RFD.
Geoff> I vote yes. Many solutions to the low signal-to-noise ratio on Usenet have
Geoff> been proposed and attempted, but I don't think anything really works
Geoff> besides moderation.
The moderation idea is just fine, but putting "moderated" in a title
always seems to rub me the wrong way. Maybe it's just because I
recall the "great Usenet renaming of 1985(?)" where we had "net.*' and
"mod.*", and after getting a zillion groups out there, we went "bleh",
and re-org'ed the whole thing.
I like comp.lang.perl.questions (moderated) myself.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 482 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Tue, 06 May 1997 12:12:34 +0100
From: Andrew Lin <lin.293@postbox.acs.ohio-state.edu>
Subject: CGI help!
Message-Id: <336F1222.8D0@postbox.acs.ohio-state.edu>
Hi,
I've been messing around with PERL and CGI's for a while now and have
been tripping over all sorts of problems.
I downloaded an experimental Form written in PERL but everytime I try it
out I get the error:
HTTP/1.0 501 Not Supported
I've already set all the permissions correctly as far as I know.
I would really appreciate it if someone here could either:
A. offer a suggestion as to what the problem is
or
B. redirect me to a more accurate newsgroup. I know this is a perl
newsgroup but I figured someone here must know something since perl is
such a popular CGI language.
Please e-mail me if you can.
Thanks
Andrew lin.293@osu.edu
------------------------------
Date: 6 May 1997 12:49:45 -0400
From: zbrown@lynx.dac.neu.edu (Zachary Brown)
Subject: Re: Comparing multi-line variables
Message-Id: <5knnf9$d8m@lynx.dac.neu.edu>
In article <336F0798.1633@unl.ac.uk>,
Alastair Aitken <a.aitken@unl.ac.uk> wrote:
|Zachary Brown wrote:
|>
|> Given two variables $a and $b containing multiple lines of ascii text, how
|> could perl locate all the start and end indices of the words or groups of
|> words that are different in one from the other and vice versa?
|
|Slowly with patterns I should think. I presume you want to use word
|boundaries as the limits of a match and not simply groups of characters
|which may or may not include whitespace. Do the ends of lines matter to
|the match rules? If not I might start by stripping the ends of lines and
|creating two arrays with the words in them. split() uses whitespace by
|default:
...
|The problem is that for example:
|
|$a = '
|this is a test string
|containing a variety of
|words and phrases';
|$b = '
|The quick brown fox
|jumps over the lazy dog';
|
|Now - the number of different strings in here is enormous. Is that what
|you want and can you be a bit more specific?
|
|In the arrays above every word is different and so each group of words
|is different too. Identifying similarities is much easier than
|differences in the example case.
The kind of text I'd be comparing will usually have only a few
differences, so it should focus on those.
But just splitting on whitespace is not good enough, because I'd have to
preserve whitespace in the final strings that are reconstituted from the
operations I perform on the differences.
The purpose of this is to put TeX markups on different versions of
documents, so I can see what is changed from the previous version, and
what was changed in the subsequent version. So I'd make new text
boldfaced, and text I discarded, italics, or something like that.
Ideally I'd feed in a list of file names containing some number of
revisions, and it would output new files containing the marked up texts.
Zack
|Alastair.
------------------------------
Date: 6 May 1997 16:52:41 GMT
From: biglizec@aol.com (Biglizec)
Subject: Current Version of Perl
Message-Id: <19970506165101.MAA12378@ladder01.news.aol.com>
Could someone tell me where I can download current version of Perl. I have
located the Perl website. However, I am interested in downloading to 3.5
disks.
I know everyone hates AOL but that is the server I am using. Is there a
way to
download this program where I can get the system to prompt me for other
disks
when one disk gets full. Or is there a new version (5.3) somewhere else?
Any
help would be appreciated.
------------------------------
Date: 6 May 1997 20:52:25 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: Current Version of Perl
Message-Id: <slrn5mv6g9.rok.I-hate-cyber-promo@news.rediris.es>
[Please wrap your lines to no more than 80 characters per line.]
In comp.lang.perl.misc,
biglizec@aol.com wrote:
>Could someone tell me where I can download current version of Perl. I have
<URL:http://www.perl.com/CPAN/src/latest.tar.gz>
>located the Perl website. However, I am interested in downloading to 3.5
>disks.
Download to your hard drive and then use some utility to split the file
into manageable chunks. Look for something called EZsplit (search
AltaVista or a similar search engine or use archie). Works for me.
HTH,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
------------------------------
Date: Tue, 06 May 1997 22:00:30 +0300
From: Shlomo Anglister <shlomoa@iil.intel.com>
Subject: DANGER !! Search patters
Message-Id: <336F7FCE.167E@iil.intel.com>
Avoid search patters with $'rs and and + signes they tend to confuse
perl.
for example try to extract a file name containing +#$@% from a full
path.
/usr/include/#TEST#++/foo++##@@$$/test%%$##$@!^.#$%
This is a good excercise, I think
--
Shlomo Anglister
IDC ATHENA group Mail stop : IDC-4C
Phone: 972-4-8230835 ( Home ) 972-4-8656056 ( Intel )
http://www.iil.intel.com/~shlomoa
------------------------------
Date: Tue, 6 May 1997 15:24:13 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: DANGER !! Search patters
Message-Id: <d14ok5.813.ln@localhost>
Shlomo Anglister (shlomoa@iil.intel.com) wrote:
: Avoid search patters with $'rs and and + signes they tend to confuse
: perl.
I think they tend to confuse perl _programmers_ more than confuse perl ;-)
: for example try to extract a file name containing +#$@% from a full
^^^^^
But the example path you provided does not contain that string?
Did you mean "... containing one of +#$@% from..."?
: path.
: /usr/include/#TEST#++/foo++##@@$$/test%%$##$@!^.#$%
: This is a good excercise, I think
I'm not sure what you're asking for...
------------------
#! /usr/bin/perl -w
$_ = '/usr/include/#TEST#++/foo++##@@$$/test%%$##$@!^.#$%';
# did you mean this:
print "'$1'\n" if m{.*/(.*)};
# or maybe you meant:
print "'$1'\n" if m{.*/(.*[+#\$@%].*)};
# ^ shut -w up
------------------
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Tue, 06 May 1997 12:33:20 -0400
From: Jim Schueler <jims@online-marketing.com>
Subject: Flushing pipes
Message-Id: <336F5D50.3C9A@online-marketing.com>
Here's some sample code that I can't seem to get to work. I can't force
filehandle 'IN' to flush until the handle is closed. Help, this is my
last resort.
BTW, I'm running perl on BSDI 2.1.
Jim Schueler
Online Marketing Company
--- code ---
#! /usr/bin/perl5
$| = 1 ;
pipe( OUT, IN ) || die ;
select( ( select( IN ), $| = 1 )[0] ) ;
unless ( fork ) {
print "Forked: \n" ;
close IN ;
print <OUT> ;
sleep 10 ;
exit ;
}
close OUT ;
@INPUT = <STDIN> ;
select( ( select( IN ), $| = 1 )[0] ) ;
print IN join( "", @INPUT ) ;
select( ( select( IN ), $| = 1 )[0] ) ;
sleep 10 ;
print join( "", @INPUT ) ;
close IN ;
------------------------------
Date: 6 May 1997 17:33:49 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: getting and derefencing in one go
Message-Id: <5knq1t$d0@lyra.csx.cam.ac.uk>
Tom Phoenix <rootbeer@teleport.com> wrote:
> $name, ', I am kevin and I am ', %{ $hashref }{kevin}, '\n";
^
You mean ${ $hashref }{kevin}, or more briefly $$hashref{kevin}.
Mike Guy
------------------------------
Date: Tue, 06 May 1997 10:55:17 -0700
From: "Ben Lai (A linuxer)" <ylai@scudc.scu.edu>
Subject: How to fit a Perl5 program to Perl4?
Message-Id: <336F7085.65224B72@scudc.scu.edu>
Hi,
Sorry about this silly question. I'm very new to Perl and this problem
is very urgent, so I come here looking for help.
I am going to establish a simple mailing server and using "Minordomo"
for it.
Since minordomo needs Perl 5 but my school just provide perl 4, I can
execute the program in my school system. I got the following error
message,
syntax error in file minordomo at line 75, next 2 tokens "use Getopt"
syntax error in file minordomo at line 86, next 2 tokens ") or"
syntax error in file minordomo at line 93, next 2 tokens ") or"
syntax error in file minordomo at line 113, next 2 tokens ") or"
syntax error in file minordomo at line 120, next 2 tokens ") or"
syntax error in file minordomo at line 160, next 2 tokens "chomp
@subscribers"
Execution of minordomo aborted due to compilation errors.
Could somebody kindly help me with correcting this program?
Greatly appreciate!!!!!
--
*****************************************************
Yu-Pin Lai
Master of Public Admin. from Eastern Washington Univ.
Master of Computer Engineering at Santa Clara Univ.
********************************************5/05/1997
------------------------------
Date: 6 May 1997 12:43:11 -0700
From: brannon@bufo.usc.edu (Terrence M. Brannon)
Subject: Re: how to use a system-installed Perl w/locally downloaded modules
Message-Id: <ysizk9lcidyr.fsf@bufo.usc.edu>
friedman@medusa.acs.uci.edu (Eric D. Friedman) writes:
>
> use lib '/path/to/my/perllib'; # includes your personal modules directory
> # in @INC
> use Data::Flow; # loads the specific module you want to use.
> # perl can find it thanks to the use lib
> # directive.
It just dawned on me. I initially thought use lib '..' was an abstract
statement in which I was supposed to substitute my desired modules
name for lib!
--
o============o Sending unsolicited commercial e-mail (UCE) to this address
Legal Notice is indication of your consent to pay me $120/hour for 1 hour
o============o minimum for professional proofreading & technical assessment.
terrence brannon * brannon@rana.usc.edu * http://rana.usc.edu:8376/~brannon
------------------------------
Date: 06 May 1997 22:27:55 +0200
From: Matthias Neeracher <neeri@iis.ee.ethz.ch>
Subject: Re: MacPerl5 on PB100
Message-Id: <86lo5sqras.fsf@iis.ee.ethz.ch>
pudge@pobox.com (Chris Nandor) writes:
> In article <E9qAAx.AvC@encore.com>, wpollans@scrap.encore.com (Warren
> Pollans) wrote:
>
> # Anyone using MacPerl5 on their pb100? I've downloaded
> # Mac_Perl_513r2 and get something like: application "unknown"
> # has unexpectedly quit, because an error of type 2 occurred.
> # What
> # does that mean - other than I can't run MacPerl5? I've been
> # using MacPerl4 with no problems.
>
> You need Mac_Perl_513r2_appl_big IN ADDITION TO Mac_Perl_513r2_appl.
Sorry, Chris, wrong answer this time: The PB100 is 68000 based, and MacPerl5
won't run on anything less than an 68020. So I'm afraid only MacPerl4 will run
on a PB100.
Matthias
-----
Matthias Neeracher <neeri@iis.ee.ethz.ch> http://www.iis.ee.ethz.ch/~neeri
``A computer scientist is someone who, when told to "Go to Hell," sees
the "go to," rather than the destination, as harmful.''
-- Roger M. Firestone
------------------------------
Date: 6 May 1997 19:29:50 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: notice to antispammers
Message-Id: <5ko0re$pu7$1@news.netusa.net>
Kyzer <kyzer@hotmail.com> wrote:
>Normally, my From: header says "junkmail@[posting host due to tin].abdn.ac.uk
>which is a valid address for reporting junkmail to. I cannot and do not wish
>to read its mailbox, it must be full of spams.
Only read the ones that start with "Re: " and you can safely ignore the
rest.
>Also, normally, my Reply-To: address is "dev.null" - the sort of address that
>causes [mumble... tchrist] to scream abuse at the top of trees.
It also causes many newsposters to attribute the post to "dev.null"
which is not very informative.
>So, since then, I've changed it to "kyzer@hotmail.com" and my hotmail account
>now contains 25 unsolicited mails, 3 of which contain attatched binaries for
>an IBM-PC, 7 of which assume I live in the USA and 2 of which are entirely
>illegal. There are no *human* communications to me at the hotmail account,
>although there are a few stupid CC:s from usenet (I can read a newsgroup,
>thankyou, stop wasting bandwidth on repeating messages, if you must really
>mail me then mail me the Message-ID)
I, for one, use email exclusively to send maybe a third of my Usenet
replies, particularly for answering FAQs and very simple questions or
correcting mistakes. Again, just check for mail that begins with "Re: "
and ignore the rest.
>My next trick will be to try Eli the Bearded's trick of "kyzer @ hotmail.com"
I mention that could be done, but I do not advise it. I advise using a
dedicated Usenet address for posting and filtering that with a
* !^Subject:(.Re:|(.*[[({ -](was|Re):))
in a procmail recipe. I have had very little wrongly sorted by that rule.
All cases I can think of for good being sorted as bad were related to the
addressing FAQ or my moderation of alt.sex.stories.moderated. There has
been very little wrongly sorted in the other direction also. Mostly hard
to categorize stuff. I have had only a few times when the "was" clause
of the regexp has been called into action. For the average Joe/Jane poster
just checking for an "Re: " in the subject should prove very effective.
>Our only hope is for removal of persistant spammer's internet feed, by the
>people who supply it in the first place. It's really just a pesky fact of
>modern life.
alt.bonehead.phil-lawlor Discussing AGIS, spam-central, CEO Phil Lawlor
alt.bonehead.sandy-wallace Discussing Sanford "Spamford" Wallace
Cyberpromo and Savetrees are Wallace, he gets connectivity from AGIS. There
was a newgroup for alt.flame.phil-lawlor, moderated by phil@agisgate.agis.net,
but my site does not carry it.
>kyzer@4u.net kyzer@hotmail.com |University or AUCC, thankfully.***** |always!
>^^^^^^^^^^^^
>This is my email address It is in my signature Anyone can read it
>However most routines for scanning news for email addresses ignore it
>Funny that, huh?
Most is not good enough. Those spam lists get traded and reused often.
I have seen spammers so desperate for addresses that they tried sending
mail to my message-IDs. (I have not yet seen a spam to the approved
address I use. Best guess is that they deliberately avoid that for fear
of the general cluefulnes of moderators.)
>Now if someone wants to contact me, and they have my news posting as a
>reference, they can see my signature.
>If they're writing with some thought, they will remind themselves to put
>one of my email addresses in their To: field
If I try to send you mail and it bounces, I will not try again. If you have
asked a question, you had better hope for more persistent attempts to answer
it. I am not in the habit of CCing posts, I do it when I have reason to
suspect someone might not otherwise see a response. Eg: following up to a
followup when the first followup has set the Followup-To: header -- one of
those happened this morning.
>If they're dumb, they'll realise as soon as they get 'User dev.null not
>known' instantly from their mailserver.
That can just be a hasty reply, not dumbness.
Elijah
------
found this mention of me even without my kibozing the feed
------------------------------
Date: Sat, 03 May 1997 17:14:25 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Claudia Ma <maclaudi@cps.msu.edu>
Subject: Re: Pattern Match Question
Message-Id: <336BD4E1.7226@egames.com>
[mail&post]
Claudia Ma wrote:
> Can someone tell me how to get rid of special chars like !, #, (, .. ?
>
> I used
> $var =~ /\!+|\#+\\(+//g;
>
> but it didn't work. :(
It's usually a good idea to tell us in what way it
didn't work if you want useful responces. Give
some sample data, tell us what you expected it to
come out as, and what your code actually did to it.
Your RE is not the most direct way to remove those chars,
but it's not *wrong* except that you wrote '\' when
you meant '|' before the '\(+' part:
$var =~ /\!+|\#+|\(+//g;
^
a simpler way to do it is:
$var =~ s/[!#(]+//g;
and a better yet, since you're really just deleting
some chars, is to use the TRanslate operator:
$var =~ tr/!#(//d;
HTH
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
"No, I'm not going to explain it. If you can't figure it out,
you didn't want to know anyway..." --Larry Wall
------------------------------
Date: Tue, 6 May 1997 19:37:07 +0100
From: "Egbert Nierop" <e.nierop@tip.nl.nospam>
Subject: Re: PERL & ADO - SQL INSERT slows after 100 Executions
Message-Id: <Oq9r0QkW8GA.194@uppssnewspub05.moswest.msn.net>
The problem should be searched at your indexes at the database; for
instance you
could have used a clustered index with a non identity primary key...
or in general there could be defined a slow performing index.
Check that first
greatings
Egbert Nierop
Robert J. Trembley wrote in article <335E7F48.7391@ctissrv1.plt.ford.com>..
.
>I have a Perl app that reads a line of data from a file, and does an
>INSERT INTO...a database (via ADO). The code is working fine - the
>problem I'm having is for files with greater than 100 lines, the first
>100 Inserts are blindingly fast, thereafter each record takes 1-2
>seconds.
>
>My ADO code looks like this:
>=========================================================
> $DB = CreateObject OLE "ADODB.Connection";
> $DB->Open( "MyDataSource" );
>
> open hFile, $FilePath;
> while($szLine = <hFile>) # Read each line in the file and parse it
> {
> ($name, $dept, $crap, $date, $name1, $name2, $name3) = split
>/%/, $szLine;
>
> $DB->Execute("Insert into table values
>('$name','$dept','$crap','$date','$name1','$name2','$name3')");
> }
> close hFile;
> }
> $DB->Close;
>=========================================================
>
>Should I be creating a COMMAND object and setting the text of the SQL?
>
>Suggestions?
>
>
------------------------------
Date: Tue, 06 May 1997 21:49:26 +0300
From: Shlomo Anglister <shlomoa@iil.intel.com>
Subject: PERL EXTENTION - PLEASE HELP
Message-Id: <336F7D36.41C6@iil.intel.com>
Hi
I am making a perl extention
are there any examples execpt the perlxstut ?
--
Shlomo Anglister
IDC ATHENA group Mail stop : IDC-4C
Phone: 972-4-8230835 ( Home ) 972-4-8656056 ( Intel )
http://www.iil.intel.com/~shlomoa
------------------------------
Date: Tue, 06 May 1997 13:42:52 -0700
From: studen04@htc.net
Subject: perl for dos
Message-Id: <336F97CC.5D5F@htc.net>
ne1 have perl4 or perl5 for dos?
--
"Narf is not only a word, its a way of life" :-)~
------------------------------
Date: 6 May 1997 20:56:04 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: perl for dos
Message-Id: <slrn5mv6n4.rok.I-hate-cyber-promo@news.rediris.es>
In comp.lang.perl.misc,
studen04@htc.net wrote:
>ne1 have perl4 or perl5 for dos?
<URL:http://www.perl.com/CPAN/ports/msdos/>
HTH,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<
------------------------------
Date: 6 May 1997 16:00:46 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: program for perl?
Message-Id: <5knkje$shr@info.abdn.ac.uk>
: Suzanne L. wrote:
: >
: > Is there a program that is needed to write in perl or can they be
: > written in any text editor?
Ah, yes, there IS a program needed to write in perl.
It's called "perl" :)
--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com |University or AUCC, thankfully.***** |always!
--
Random sig of the day:
sh: cookie not found
------------------------------
Date: 6 May 1997 16:48:43 GMT
From: gebis@purcell.ecn.purdue.edu (Michael J Gebis)
Subject: Re: program for perl?
Message-Id: <5knndb$8nl@mozo.cc.purdue.edu>
junkmail@sysa.abdn.ac.uk (Kyzer) writes:
}: Suzanne L. wrote:
}: >
}: > Is there a program that is needed to write in perl or can they be
}: > written in any text editor?
}Ah, yes, there IS a program needed to write in perl.
}It's called "perl" :)
Technically, that's the program needed to run perl. You can write in
perl using almost anything, from emacs to antelope blood on a cave wall.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: 6 May 1997 18:36:07 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: program for perl?
Message-Id: <5kntmn$3iq@info.abdn.ac.uk>
Michael J Gebis, while smelling of fish, wrote:
: junkmail@sysa.abdn.ac.uk (Kyzer) writes:
: }: Suzanne L. wrote:
: }: >
: }: > Is there a program that is needed to write in perl or can they be
: }: > written in any text editor?
: }Ah, yes, there IS a program needed to write in perl.
: }It's called "perl" :)
: Technically, that's the program needed to run perl. You can write in
: perl using almost anything, from emacs to antelope blood on a cave wall.
But the $64000 question is, if you write it in antelope blood on a cave wall,
can you get perl to execute it afterwards? :)
--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com |University or AUCC, thankfully.***** |always!
--
Random sig of the day:
sh: cookie not found
------------------------------
Date: 6 May 1997 09:59:52 -0700
From: brannon@bufo.usc.edu (Terrence M. Brannon)
Subject: q: Can't figure out autoloading
Message-Id: <ysizsp00ilix.fsf@bufo.usc.edu>
I want to autoload a simple string-trimming function instead of
manually adding it to each file I use it in. Unfortunately, I can't go
from the theoretical, example-less Blue Camel discussion of AutoLoad
and AutoSplit to a working, auto-loadable function. I also wonder what
necessitated {Auto,Dyna,Self}Load instead of just one or the other.
root@palm /felix/terry/scripts/perl : ls -lR auto
total 1
drwxr-xr-x 2 brannon root 512 May 6 09:44 PS
auto/PS:
total 3
-rw-r--r-- 1 brannon root 164 May 6 09:22 PS.al
-rw-r--r-- 1 brannon root 77 May 6 09:19 trim.al
-rw-r--r-- 1 brannon root 77 May 6 09:19 trim.al~
root@palm /felix/terry/scripts/perl : perl -de 42
Stack dump during die enabled outside of evals.
Loading DB routines from perl5db.pl patch level 0.95
Emacs support available.
Enter h or `h h' for help.
main::(-e:1): 42
DB<1> PS::trim("string \n")
Undefined subroutine &PS::trim called at (eval 3) line 2, <IN> chunk 1.
DB<2> use AutoLoader
DB<3> PS::trim("string \n")
Undefined subroutine &PS::trim called at (eval 7) line 2, <IN> chunk 3.
DB<4>
--
o============o Sending unsolicited commercial e-mail (UCE) to this address
Legal Notice is indication of your consent to pay me $120/hour for 1 hour
o============o minimum for professional proofreading & technical assessment.
terrence brannon * brannon@rana.usc.edu * http://rana.usc.edu:8376/~brannon
------------------------------
Date: Tue, 06 May 1997 17:27:46 GMT
From: raymondc@microsoft.com.--- (Raymond Chen)
Subject: Re: rational systems inc. annoying message in perl 5.000
Message-Id: <336f69bb.4730961@157.55.96.156>
The message isn't coming from perl; it's coming from the DOS
extender that the perl-for-DOS port uses. Set the environment
variable
set DOS4G=QUIET
to suppress the copyright notice from the extender.
--
(My return address is intentionally invalid; delete ".---" to get my real address.)
------------------------------
Date: 6 May 1997 18:09:10 GMT
From: tommy@best.com (Tom Vaughan)
Subject: Re: scalar holds compiled code
Message-Id: <5kns46$9o9$1@nntp1.ba.best.com>
Alastair Aitken (a.aitken@unl.ac.uk) wrote:
: Tom Vaughan wrote:
: >
: > Abigail (abigail@fnx.com) wrote:
: > : Look up in the manual or the Camel:
: > : system, qx, backticks and exec.
: >
: > Unfortunately no. The functions you've mentioned involve file access.
: > In my case, $STUFF already holds the contents of what could be considered a
: > file. What I need is a way to execute not a file but a location in memory.
: eval ("$STUFF");
: Alastair.
Nope. Eval only works on perl code.
--
Tom Vaughan <tommy@best.com>
------------------------------
Date: 5 May 1997 23:45:18 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Singles and doubles
Message-Id: <5klree$2tp@pirate.shu.edu>
Hello -
christopher <mrchristopher@inorbit.com> writes:
>How can I define a string that contains stuff to be evaluated so that it
>isn't evaluated the first time it's defined but rather when it's used
>inside double quotes..
>So if anyone can tell me how to make this idea work..
>$stuff='$this+$that';
>$that=5;
>while <FILE> {
>$this++;
>$theanswer="10+$stuff";
>}
Hmmm... not evaluated when it's defined, but later.... You might want
to use a subroutine:
#!/usr/local/bin/perl -w
use strict;
my ($this, $that, $theanswer);
sub these { $this + $that } # define up here or prototype
$that = 5;
$this = 6;
$theanswer = 10 + these;
print $theanswer; # prints 21
David Black
dblack@icarus.shu.edu
------------------------------
Date: Tue, 06 May 1997 14:43:58 -0500
From: "Brandon W. Metcalf" <brandon@physics.utexas.edu>
Subject: slow script
Message-Id: <336F89FE.167E@physics.utexas.edu>
Below is a script that generates a user specified number of "lottery
tickets." Each lottery ticket consist of 6 unique numbers between 1 and
50 inclusive. The script does checking to ensure that each ticket is
unique and that each number within a ticket is also unique. However, if
more that say 19 tickets are requested, it's slows to a crawl. I'm sure
that the code could be improved, but where? Can it be optimized or is
perl just slow at this sort of procedure?
#!/usr/local/bin/perl -w
use strict;
srand;
my (
$tickets, # number of tickets to generate
$num, # one lotto number
@array, # array where each row represents a ticket
$whole # ref to $tickets x 6 array
);
print "How many tickets: ";
$tickets = <STDIN>;
chomp $tickets;
foreach (0 .. ($tickets - 1)) {
$whole->[$_] = [ (0, 0, 0, 0, 0, 0) ];
}
foreach (1 .. $tickets) {
mk_ticket();
print "got ticket $_\n";
my $j = $_ - 1;
TEST: while ($j >= 0) {
my $i = 0;
while ($i <= 5) { # make sure set of numbers isn't
duplicated
if ($array[$i] == $whole->[$j]->[$i]) {
mk_ticket();
$j = $_ - 1;
redo TEST;
}
$i++;
}
$j--;
}
$whole->[$_ - 1] = [ @array ];
}
foreach (0 .. ($tickets - 1)) {
my $i;
foreach $i (0 .. 5) {
printf "%3d", $whole->[$_]->[$i];
}
print "\n";
}
sub mk_ticket {
@array = (0, 0, 0, 0, 0, 0);
foreach (0 .. 5) {
mk_number();
my $i = $_;
TEST: while ($i >= 0) { # make sure a number isn't duplicated
if ($num == $array[$i]) {
mk_number();
$i = $_;
redo TEST;
}
$i--;
}
$array[$_] = $num;
}
@array = sort { $a <=> $b } @array;
return @array;
}
sub mk_number {
$num = int(rand(50)) + 1;
return $num;
}
--
Brandon Metcalf
UNIX Systems Administrator
Department of Physics - UT Austin
brandon@physics.utexas.edu
------------------------------
Date: 06 May 1997 12:24:31 -0400
From: Ken Anderson <anderson@necsys.gsfc.nasa.gov>
Subject: system () won't execute the called program.
Message-Id: <y7xenbk7em8.fsf@necsys.gsfc.nasa.gov>
Hi again,
I have a perl program which has to execute an external
c program, so i am using
system("cprog -p prog.par") && die "cprog failed. $!\n";
It simply does nothing. cprog never starts. no error message.
I have ensured that the environment is ok--in fact i can run
cprog from the command line exactly as it appears in the string.
I checked to make sure that Perl is getting the path. And even
if it wasn't, at least i would expect the error message.
I have used system calls before and have never seen this behaviour.
As a check, i put in another system call:
system("ls -l") && die " could not ls. $!\n";
just before the one above and that worked fine.
What am i missing?
thanks!!
ken
The earth is spinning madly through space and I
sit in front of a TV screen all bloody day.
--------------------------------------------------------------------
Kenneth Anderson | Code631 Astrophysics Data Facility
Hughes STX | email: anderson@ssvs.gsfc.nasa.gov
Goddard Space Flight Center | ph: 301 286 1375
Greenbelt, MD |
--------------------------------------------------------------------
------------------------------
Date: Tue, 06 May 1997 12:50:13 -0400
From: Buzz Moschetti <buzz@bear.com>
Subject: TIEARRAY Q
Message-Id: <336F6145.31AF@bear.com>
Assume that TieTest is a class package to tie a normal array.
It seems that once I tie an array, I cannot use it as a normal
array outside of the STORE/FETCH context. The following example
does not print "perl0 perl1" as expected:
use TieTest;
tie(@arr, TieTest1);
$arr[0] = "perl0";
$arr[1] = "perl1";
print "arr: @arr\n";
I'm sure (well, actually, hoping) that it is merely a misunderstanding
on my part of how to start up sub TIEARRAY.
Any clues would be most appreciated.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 441
*************************************