[12747] in Perl-Users-Digest
Perl-Users Digest, Issue: 157 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 15 17:07:13 1999
Date: Thu, 15 Jul 1999 14:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 15 Jul 1999 Volume: 9 Number: 157
Today's topics:
Re: Anybody know how to to this? (Lee)
Authentication via form? <pmt@top.mitre.org>
Backticks failure <bivey@teamdev.com>
Re: Beginner in perl, checking header and footer <jason@killdare.demon.co.uk>
Re: Beginner in perl, checking header and footer (Jerome O'Neil)
Re: Communication between CGI and apache <warss@mail.gv2.net>
Re: crypt() doesn't decrypt (Bart Lateur)
DBI - alternate row colors <pmallasch@mail.starnews.com>
File sync with Perl <dcohny@earthlink.net>
Re: File sync with Perl (Greg Bacon)
Re: Future of Perl (Reini Urban)
Re: Garbage Collection Performance <tobez@plab.ku.dk>
Re: getting modify times with perl&unix (Larry Rosler)
Re: Help!: trying to compile my scripts <thing@shambolica.freeserve.co.uk>
lexical $_ with threads question? <derek_sherlock@hp.com>
My Foot Hurts <Coyote@shambolica.freeserve.co.uk>
Re: My Foot Hurts <prlawrence@lehigh.edu>
Re: My Foot Hurts <jcreed@cyclone.jprc.com>
Re: My Foot Hurts (Greg Bacon)
Re: Old database is erased when I add new information (Neko)
Perl , & serial port under HPUX 10.2 larry.dalessandro@ae.ge.com
Perl and MS Access DBs <f.agolli@studenti.to.it>
Re: Perl and MS Access DBs <stephen.aze@zetnet.co.uk>
Re: Perl on NT - SIG handlers (Larry Rosler)
Re: Perl on NT - SIG handlers (Neko)
Re: perl's edge -- a beginner's question <dchristensen@california.com>
Perlscript calling VBScript function kharimi@my-deja.com
Re: regexp in substr? <hiller@email.com>
Re: regexp in substr? (Bart Lateur)
Re: regexp in substr? (Larry Rosler)
Tcl-to-Perl translator? (Larry Rosler)
TIe::IxHash <Joe.Rocklin@sdrc.com>
Re: Tiny error in perlfaq5 <cs2400@hotmail.com>
Re: Tiny error in perlfaq5 (John Borwick)
Re: Tiny error in perlfaq5 <tchrist@mox.perl.com>
Re: Tiny error in perlfaq5 (Michael Rubenstein)
Re: Tiny error in perlfaq5 (John Borwick)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 15 Jul 1999 14:06:57 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: Anybody know how to to this?
Message-Id: <B3B39B81966854A24C@204.112.166.88>
In article <378CB93E.C41290B4@venice.cas.utk.edu>,
toby <toby@venice.cas.utk.edu> wrote:
>I think you may want to split the variable into chunks and put them into an
>array:
>
>@blah = split /somedelimter/, $text;
>foreach $blah (@blah) {
>print $blah . '<br>';
>}
or...
print "<pre>\n$text</pre>\n";
Lee
------------------------------
Date: Thu, 15 Jul 1999 15:38:59 -0400
From: Patrick Tully <pmt@top.mitre.org>
Subject: Authentication via form?
Message-Id: <378E38D3.C3E749F1@top.mitre.org>
Hi,
I want to be able to authenticate a user via a form instead of a
browser pop-up window, with a .htaccess file. Does anyone know of a
SMALL script that will simply check a user's id/pw with the .htaccess
file and log them in (without a pop-up window)? If not any refrences on
how to go about doing this? It seems as though it would be quite easy,
but i have found little information on it.
------------------------------
Date: 15 Jul 1999 19:52:25 GMT
From: "William" <bivey@teamdev.com>
Subject: Backticks failure
Message-Id: <01becefb$a65a4700$583c08cf@bill.jump.net>
I asked this a while back, no response so why not ask
again, eh?
Here's the deal: I was handed some code that uses backticks to
execute a .exe file. Unfortunately, it doesn't on my Windows 95
and 98 systems. (Except, once, this morning, it did. Subsequently,
with no changes, it fails.)
I can get it to work if I supply an explicit path from the root,
but only to one directory level. Two directories are too much.
(The command file is in two directories in the path, also in the
root, current and target directories. Basically, I scattered that
puppy everywhere - Perl just cannot find it.)
I'm using Activestate's build 517. -Wm
------------------------------
Date: Thu, 15 Jul 1999 14:25:58 +0100
From: Jason <jason@killdare.demon.co.uk>
Subject: Re: Beginner in perl, checking header and footer
Message-Id: <yntF7AAmFej3Ew5M@shambolica.freeserve.co.uk>
In article <slrn7ol9ho.h7.abigail@alexandra.delanet.com>, Abigail
<abigail@delanet.com> writes
>If I can find the answer in both learning Perl and the cookbook within
>10 minutes, do I get your first born son?
You can have mine instead, although I have not got one yet so we would
have to make one between us. Are you still interested (in fusing your
high powered DNA with my worthless trash)?
--
Jason@shambolica.freeserve.co.uk
------------------------------
Date: 15 Jul 1999 20:17:06 GMT
From: jeromeo@atrieva.com (Jerome O'Neil)
Subject: Re: Beginner in perl, checking header and footer
Message-Id: <7mlfk2$644$1@brokaw.wa.com>
In article <yntF7AAmFej3Ew5M@shambolica.freeserve.co.uk>,
Jason <jason@killdare.demon.co.uk> writes:
> In article <slrn7ol9ho.h7.abigail@alexandra.delanet.com>, Abigail
> <abigail@delanet.com> writes
>>If I can find the answer in both learning Perl and the cookbook within
>>10 minutes, do I get your first born son?
>
> You can have mine instead, although I have not got one yet so we would
> have to make one between us. Are you still interested (in fusing your
> high powered DNA with my worthless trash)?
I think it would take a bit more than fusing DNA.
Like surgury.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.i-filezone.com
------------------------------
Date: Thu, 15 Jul 1999 16:30:35 -0400
From: "Perl Newgroup" <warss@mail.gv2.net>
Subject: Re: Communication between CGI and apache
Message-Id: <ysrj3.27$0J4.443549@typ12.nn.bcandid.com>
I believe what you can do is look at another search engine secript..
And see how they make them see how they aren't CPU intensive
<weixian_shen@my-deja.com> wrote in message
news:7l6knh$3vj$1@nnrp1.deja.com...
> I am writing a web search engine. It search engine is very
> CPU intensive, and may take up to 2~3 min to complete. I would
> like to stop the search when users become inpatient and hit
> the "STOP" button on the browser. Is there a way to detect that
> from the CGI? I thought apache will send a SIGPIPE or SIGHUP,
> but it doesn't. Any suggestion will be greatly appreciated.
>
> Wei
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: Thu, 15 Jul 1999 19:29:18 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: crypt() doesn't decrypt
Message-Id: <37903603.7667584@news.skynet.be>
Dr. Who wrote:
>what's the point in encrypting someting that is decryptable?
You mean "is not descryptable".
To make this clear, you're asking something like "what's the use of
calculating the CRC of a file if you can't reconstruct the file from the
CRC". Because, in many ways, crypt() produces a result similar to CRC.
Bart.
------------------------------
Date: Thu, 15 Jul 1999 16:04:07 -0600
From: "K. Paul Mallasch" <pmallasch@mail.starnews.com>
Subject: DBI - alternate row colors
Message-Id: <F_rj3.344$Cs3.4007015@news.netdirect.net>
Anyone have an easy way to alternate row colors when displaying results from
a mySQL query?
Thanks,
K. Paul Mallasch - Webmaster
http://www.thestarpress.com
------------------------------
Date: Thu, 15 Jul 1999 15:38:51 -0400
From: "David C" <dcohny@earthlink.net>
Subject: File sync with Perl
Message-Id: <7mldc9$gc3$1@ash.prod.itd.earthlink.net>
Does someone know of a script or a module that does file mirroring for http
servers? I am trying to reverse proxy two http servers and need a back end
script that does this. Thanks in advance
------------------------------
Date: 15 Jul 1999 20:37:06 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: File sync with Perl
Message-Id: <7mlgpi$154$1@info2.uah.edu>
In article <7mldc9$gc3$1@ash.prod.itd.earthlink.net>,
"David C" <dcohny@earthlink.net> writes:
: Does someone know of a script or a module that does file mirroring for
: http servers? I am trying to reverse proxy two http servers and need
: a back end script that does this. Thanks in advance
Do you want instant mirroring, or would you be content with periodic
mirroring? If the latter is what you want, check out lwp-mirror that
comes with the (surprise) LWP.
Greg
--
I have not finished with a woman until I have had her all three ways.
-- John F. Kennedy.
------------------------------
Date: Thu, 15 Jul 1999 20:14:39 GMT
From: rurban@xarch.tu-graz.ac.at (Reini Urban)
Subject: Re: Future of Perl
Message-Id: <378e40b4.43505087@judy.x-ray.local>
"Alan J. Flavell" <flavell@mail.cern.ch> wrote:
>> Some say Java will replace Perl.
?
>Do they, indeed. A respected colleague recommends that new students
>should learn Java as their first programming language, although he
>doesn't want to see them actually using it in practice.
i'd rather prefer people starting with any functional language, like ml,
scheme, haskell, dylan or such.
or java, c++ is much easier to get then.
and for perl it doesn't harm as well. perl is a mess, but nice.
>In real life he expects them to use C++ for major applications, and Perl modules for
>scripting, proof-of-concept prototypes, etc. In many cases, you know,
>it turns out that the prototype works well enough, and the "real"
>implementation is never produced. But this is in a research situation.
>You have to apply the available skills and techniques to your own
>situation, there is, and can be, no one answer that fits all
>requirements.
--
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html
------------------------------
Date: Thu, 15 Jul 1999 21:44:42 +0200
From: Anton Berezin <tobez@plab.ku.dk>
Subject: Re: Garbage Collection Performance
Message-Id: <19990715214442.B2302@lion.plab.ku.dk>
On Thu, Jul 15, 1999 at 02:45:07PM +0000, Jeremy Purdy wrote:
> > > I have a data-intensive application that I am writing in PERL. It
> > > uses a LARGE amount of memory while processing, but runs fairly
> > > efficiently.
> >
> > Define ``LARGE''.
> My buffers for I/O are 2M in size, so I would not be surprised if the
> application allocates 10M+.
Well, this can hardly be qualified as ``large'', even less so as
``LARGE''. :-)
You see, if you want some help with your problem in this newsgroup, you
should really tell us more. The current description is too vague.
Probably the best thing you can do is to post here a distilled version
of your script --- just a bare minimum that still has the problem you
described. The details about your environment would be helpful, as
well: an OS, its version, the version of Perl, does Perl use its own
malloc, or it uses the system malloc and so on.
The behavior you describe is very unusual. Everybody who used Perl to
process really ``LARGE'' amounts of data will tell you that. Just ask
PDL people, or even Tk people. It is not unusual to see 200M+ memory
footprint for a Perl application and still I have never heard of such a
problem as you experience.
> Well, I can't say for sure what it is doing, but there is this 10 min
> pause after the last line of code is executed (processing take about
> 14 min up until this point) before the application actually shuts
> down.
Do you have any END {} blocks in your app? Any DESTROY {} blocks? Any
heavy XS modules?
Tell us more!
--
Anton Berezin <tobez@plab.ku.dk>
The Protein Laboratory, University of Copenhagen
------------------------------
Date: Thu, 15 Jul 1999 12:13:11 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: getting modify times with perl&unix
Message-Id: <MPG.11f7d2a2bd035488989cd9@nntp.hpl.hp.com>
In article <scpj3.448$cd5.28752@typ42b.nn.bcandid.com> on Thu, 15 Jul
1999 17:51:20 GMT, Matthew Bafford <*@dragons.duesouth.net> says...
> Larry Rosler), thinking with his hands, posted the following to
> comp.lang.perl.misc:
> : In article <slrn7opq3a.4jl.*@dragons.duesouth.net> on Wed, 14 Jul 1999
> : 20:08:43 GMT, Matthew Bafford <*@dragons.duesouth.net> says...
> : ...
> : > $mtime = qx!remsh $hostname "perl -e 'print modtime'"!;
> :
> : Please clarify what this actually does.
>
> I really didn't expect anyone to have any problems with this.
>
> Oh well, perhaps I should have written:
>
> # replace <stat and print modtime> with the appropriate code:
> $mtime = qx!remsh $hostname "perl -e '<stat and print modtime>'"!;
Yes, perhaps you should have, to help the clueless who might think you
had something up your sleeve.
'code' ne 'pseudo-code';
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 15 Jul 1999 13:31:59 +0100
From: The Thing of Rock 'N Roll <thing@shambolica.freeserve.co.uk>
Subject: Re: Help!: trying to compile my scripts
Message-Id: <l0bwfBA$Sdj3UwLq@shambolica.freeserve.co.uk>
In article <slrn7obv1n.h7.abigail@alexandra.delanet.com>, Abigail
<abigail@delanet.com> writes
>Don Smith (smithda@webwide.net) wrote on MMCXXXVIII September MCMXCIII in
><URL:news:7m45sa$5fd$1@news.unicomp.net>:
>||
>|| I am trying to find a method of hiding my sources from the public.
>
>Easy. Put the sources on a machine. Unplug all the network cables.
>Put the machine in a closet. Lock the closet. Throw away the key.
>
>Then read the FAQ.
>
>
>Abigail
In a similar vein, I am trying to find a method of hiding myself from
the public. Can anyone offer any suggestions?
The Thing
--
The Thing of Rock 'N Roll
------------------------------
Date: Thu, 15 Jul 1999 13:11:47 -0600
From: Derek Sherlock <derek_sherlock@hp.com>
Subject: lexical $_ with threads question?
Message-Id: <378E3273.D1CD6896@hp.com>
Hi,
Despite reading many man/perldoc pages and searching dejanews,
I still haven't found a good explaination of the behavior of
the "lexical" $_ and @_ in threaded perl. Can someone
recommend what I should read?
My question has nothing to do with threads per se. But it is
about the behavior of the threading-enabled perl.
Here's what's puzzling me:
When you implicitly "localize" a variable by using it as the
iterator in a foreach loop, the behavior is consistent with
the variable type: If it was a global, it is just like using
the perl "local" operator on it. If it was a lexical (defined
outside the loop), it is much like using a "my" on it. This
much I have verified using simple experiments: In both cases,
the iterator is visible from inside the loop, and in the global
case, it is also visible from subroutines called from within
the loop. In both cases, the original value from before
entering the loop, is undisturbed if you print it out after
the loop terminates.
So far no mystery.
Now, I repeat the same experiment with $_, which is lexical
according to perldelta. (And I have verified it's lexical
nature by overwriting $main::_ and seeing no change in $_).
$_ seems to behave mostly like a lexical. But when I use it
as a foreach iterator, and call a subroutine from within the
loop, the subroutine sees the iterator value, rather than the
original value from before the loop was entered.
What is going on? The behavior seems logical, given that
$_ is global in non-threaded perl and nobody wants to break
backwards compatibility. But if $_ really is "special" in
that its behavior isn't quite like a lexical nor quite like
a global, where is this documented? And how is it implimented.
The lexical nature of variables is supposed to be known at
compile time, isn't it? So how does the compiler know when
it compiles a subroutine that messes with $_ whether to mess
with the copy at it's own lexical level (normal behavior),
or the one at the caller's level (aparent foreach $_ behavior)?
Very confused indeed,
Derek.
CODE EXAMPLES:
# Case 1: Normal LEXICAL behavior
use Thread;
my $a=1;
foreach $a (2,3)
{
print "in loop $a\n";
&do_it;
}
print "residual: $a\n";
sub do_it
{
print "in sub $a\n";
}
Output:
in loop 2
in sub 1
in loop 3
in sub 1
residual: 1
# Case 2: Normal GLOBAL behavior
use Thread;
$a=1;
foreach $a (2,3)
{
print "in loop $a\n";
&do_it;
}
print "residual: $a\n";
sub do_it
{
print "in sub $a\n";
}
Output:
in loop 2
in sub 2
in loop 3
in sub 3
residual: 1
# Case 3: "lexical $_" behavior
# Note the "in sub" values printed out
# How come they don't match the lexical
# example above (case 1)?
use Thread;
$_ = 1;
foreach $_ (2,3)
{
print "in loop $_\n";
&do_it;
}
print "residual: $_\n";
sub do_it
{
print "in sub $_\n";
}
Output:
in loop 2
in sub 2
in loop 3
in sub 3
residual: 1
--
___ __ /___ ___ Derek Sherlock
| / /_ _ \ | Workstation Systems Lab (WSL)
| / / // / \ | 3404 E. Harmony
| \ / //_/ / | Fort Collins CO 80528
|___\_ /____/___|
/ Direct: 970-898-7582
H E W L E T T Fax: 970-898-7388
P A C K A R D Email: derek_sherlock@hp.com
------------------------------
Date: Thu, 15 Jul 1999 13:35:17 +0100
From: Don Coyote <Coyote@shambolica.freeserve.co.uk>
Subject: My Foot Hurts
Message-Id: <hUVx3CAFWdj3QwBO@shambolica.freeserve.co.uk>
Hi,
My left foot hurts, I've read the FAQ and tried switches -t & -w but
nothing seems to work.
BTW, I did buy a cheap pair of shoes a few days ago and have done a lot
of walking in them but I can't see how that relates to Perl?
Any help would be appreciated
Thanks, Coyote
--
Don Coyote
------------------------------
Date: Thu, 15 Jul 1999 16:02:44 -0400
From: "Phil R Lawrence" <prlawrence@lehigh.edu>
Subject: Re: My Foot Hurts
Message-Id: <7mleqf$2348@fidoii.cc.Lehigh.EDU>
Don Coyote <Coyote@shambolica.freeserve.co.uk> trolled:
> My left foot hurts, I've read the FAQ and tried switches -t & -w but
> nothing seems to work.
>
> BTW, I did buy a cheap pair of shoes a few days ago and have done a lot
> of walking in them but I can't see how that relates to Perl?
Sorry, no one can help you here. Try comp.lang.perl
> Any help would be appreciated
>
> Thanks, Coyote
Don't mention it.
> --
> Don Coyote
Phil R Lawrence
------------------------------
Date: 15 Jul 1999 16:17:58 -0400
From: Jason Reed <jcreed@cyclone.jprc.com>
Subject: Re: My Foot Hurts
Message-Id: <a1oghdhdl5.fsf@cyclone.jprc.com>
Don Coyote <Coyote@shambolica.freeserve.co.uk> writes:
> Hi,
>
> My left foot hurts, I've read the FAQ and tried switches -t & -w but
> nothing seems to work.
Duh, you should use '-T', not '-t'. Or get some Dr. Scholl's
Odor-Eaters, if your feet are *really* tainted.
---Jason
------------------------------
Date: 15 Jul 1999 20:39:41 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: My Foot Hurts
Message-Id: <7mlgud$154$2@info2.uah.edu>
In article <hUVx3CAFWdj3QwBO@shambolica.freeserve.co.uk>,
Don Coyote <Coyote@shambolica.freeserve.co.uk> writes:
: My left foot hurts, I've read the FAQ and tried switches -t & -w but
: nothing seems to work.
Try reading the docs again:
[15:38] ettsn% (grep -i left *.pod ; grep -i foot *.pod) | wc -l
181
Greg :-)
--
A lot of people mistake a short memory for a clear conscience.
-- Doug Larson
------------------------------
Date: 15 Jul 1999 19:41:12 GMT
From: tgy@chocobo.org (Neko)
Subject: Re: Old database is erased when I add new information
Message-Id: <7mldgo$t7s$0@216.39.141.200>
On 15 Jul 1999 16:21:51 GMT, stanley@skyking.OCE.ORST.EDU (John Stanley)
wrote:
>In article <7mjsrm$1er$0@216.39.141.200>, Neko <tgy@chocobo.org> wrote:
>>
>>Your reputation is enhanced by someone who can edit your code and send in
>>patches for overlooked bugs than by someone who cannot do that.
>
>Yes, perhaps, but unfortunately the person who can do that is much less
>likely to go around the net announcing his praise for you than the idiot
>who "fixes" your code and calls you unethical because you won't fix it
>for him.
Larry Wall's reputation is not enhanced because porters such as Chip and
Sarathy go around praising him for writing Perl. It is enhanced because a
plethora of programmers such as them contributed time, code and patches.
Imagine where Perl would be today if Larry had hidden the source for fear
that someone might look under the hood -- edit, edit, edit -- and then rail
against him because Perl is broken.
>>Your time is
>>saved everytime by someone who can edit your code and offers to fix it for
>>you than by someone can't.
>
>Ummm, no actually it isn't. It takes me much less time to be told of a
>bug and fix it myself than to try incorporating changes made by someone
>else.
Most bug reports look like this:
"Your program corrupts my file. Can you fix it?"
Most patches pinpoint the problem. Even if you can't apply the patch, you
know where the problem is and can more easily fix it.
>I currently have some code that is being used to two other people.
>They have both made enhancements to that code, as have I. I am now faced
>with trying to merge all three versions. I saved time on the front end
>by not making the changes myself, but lose time because I still have to
>incorporate their sometimes conflicting fixes with my code which is now
>different from what they have.
Would you rather that these two people had simply sent in feature requests?
"I want you to add features A, B, C and X, Y Z. Thank you."
That's pretty much what they've done, except they've also included examples
of the features actually implemented! If you don't want to merge their code
with yours, you can still write it all from scratch. No harm done. No time
wasted.
>If doing this were such a wonderful timesaver, nobody would have written
>any of the several version control systems (e.g. SCCS, RCS ...). They
>would have had so much time saved by having multiple versions that they
>wouldn't need to control them.
If you have version control, how did you end up with multiple versions? Oh,
wait, you only have one version. Your two users have forked off entirely
different programs. If you want to merge them back, then fine. If you
don't, then don't. Maybe it's easier to eschew their code and just implement
their ideas on your own. Choose whichever wastes less of your time.
>An additional benefit of doing the fixes yourself is that you can give
>the user code that has had other bugs that he hasn't found fixed, and
>won't he think you are a wonderful person for giving him a free update?
If you want all the credit, you do all the hard work yourself. If you're
lazy, you get other people to do all the hard work for you. You convince
them to send you patches. And when a bug is fixed, everyone can apply the
patch right there and then. They don't have to wait for a free update.
Hiding the source just keeps other programmers from helping you. It doesn't
stop the lusers -- they can just as easily corrupt a compiled program and
call you names for allowing such a thing to happen.
--
Neko | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=
------------------------------
Date: Thu, 15 Jul 1999 20:51:23 GMT
From: larry.dalessandro@ae.ge.com
Subject: Perl , & serial port under HPUX 10.2
Message-Id: <7mlhk5$rat$1@nnrp1.deja.com>
I'm new to Perl but have hopes of using it on several projects here
at work. I've installed it and am coming up to speed ever so slowly.
But it would help me a lot if someone has an example of a Perl
script that opens a serial port under Unix, and writes out a string.
In my exact case I need to open a port at 1200 baud, w/N81 for paramters
and send out the string RESET\n\r. I'v also installed the IO-Stty,
IO-Tty and expect packages.
Any/All help appreciated.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 15 Jul 1999 21:17:24 +0200
From: "Fredi Agolli" <f.agolli@studenti.to.it>
Subject: Perl and MS Access DBs
Message-Id: <7mlcg5$uu6$1@menelao.polito.it>
Hi to everybody,
I'm looking for Perl modules which manage MS Access Databases. May you give
me some information about this?
Thank's in advance.
Fredi
------------------------------
Date: Thu, 15 Jul 1999 21:44:56 +0100
From: Stephen Aze <stephen.aze@zetnet.co.uk>
Subject: Re: Perl and MS Access DBs
Message-Id: <1999071521445666754@zetnet.co.uk>
The message <7mlcg5$uu6$1@menelao.polito.it>
from "Fredi Agolli" <f.agolli@studenti.to.it> contains these words:
> I'm looking for Perl modules which manage MS Access Databases.
> May you give me some information about this?
If you're going to do it the Microsoft way, you may as well go all
the way: Forget Perl and do it with Active Server Pages on an NT
server - ASP's designed to work with Access databases.
------------------------------
Date: Thu, 15 Jul 1999 12:05:20 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl on NT - SIG handlers
Message-Id: <MPG.11f7d0ccb48be4989cd8@nntp.hpl.hp.com>
In article <7ml5q4$m0c$1@nnrp1.deja.com> on Thu, 15 Jul 1999 17:29:57
GMT, Stephen Pandich <pandich@my-deja.com> says...
> > > I have a fair amount of experience with Perl on UNIX, but I am still
> > > pretty new to the Perl on NT world. Is anyone aware of something
> > > like signal handlers for NT perl?
> > >
> > > I am specifically looking for ways to trap control-c.
> >
> > Did you try setting $SIG{INT} to a handler? It should work the same
> > on NT as on Unix.
>
> I tried $SIG{'INT'} and it did not work when I did a control-c from the
> command prompt. The program merely exits (like a kill -9)
You are right. I thought I had tested this at some point, but I tried
again now and it failed.
I just looked through the ActivePerl Win32 FAQ and another FAQ it points
to, but couldn't find anything about this. Maybe someone else can help.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 15 Jul 1999 21:01:19 GMT
From: tgy@chocobo.org (Neko)
Subject: Re: Perl on NT - SIG handlers
Message-Id: <7mli6v$440$0@216.39.141.200>
On Thu, 15 Jul 1999 12:05:20 -0700, lr@hpl.hp.com (Larry Rosler) wrote:
>In article <7ml5q4$m0c$1@nnrp1.deja.com> on Thu, 15 Jul 1999 17:29:57
>GMT, Stephen Pandich <pandich@my-deja.com> says...
>> I tried $SIG{'INT'} and it did not work when I did a control-c from the
>> command prompt. The program merely exits (like a kill -9)
>
>You are right. I thought I had tested this at some point, but I tried
>again now and it failed.
>
>I just looked through the ActivePerl Win32 FAQ and another FAQ it points
>to, but couldn't find anything about this. Maybe someone else can help.
IIRC, from my own experience, earlier versions of Perl for Win32 would catch
the first SIGINT, but miss any subsequent ones. This could be why you
thought $SIG{INT} would work. ActivePerl 5.005_02 fails altogether though.
--
Neko | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=
------------------------------
Date: Thu, 15 Jul 1999 12:36:59 -0700
From: "David Christensen" <dchristensen@california.com>
Subject: Re: perl's edge -- a beginner's question
Message-Id: <378e366f@news5.newsfeeds.com>
Hello, World!
>> > Fernando Morais Dasilva (fmd@wam.umd.edu) wrote:
>> >
>> > : i'm just getting started on learning perl. i wanted an
example of
>> > : something that perl can do easier that c, c++ would take a
lot more
>> > : effort.
"The Practice of Programming" by Kernighan & Pike does some
interesting comparisons along these lines -- various examples, each
written in C, C++, Perl, and Awk (I believe). It's a good read,
and I recommend it to all programmers.
The example that I found memorable was a random text generator
using Markov chains -- the C implementation was several pages, C++
was shorter, Awk was one or two pages, and Perl was about 2/3 of a
page. I am not certain of running times, but believe that Perl was
comparable to the fastest. Perl's big advantage was its dynamic
data structures and useful syntax.
--
David Christensen
dchristensen@california.com
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 15 Jul 1999 19:48:30 GMT
From: kharimi@my-deja.com
Subject: Perlscript calling VBScript function
Message-Id: <7mldu9$pl6$1@nnrp1.deja.com>
gurus, geeks and nerds.....please scratch thy brains on this one.......
how do I make a call to a VBScript funstion/subroutine from Perlscript
code??
- Karimi
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 15 Jul 1999 19:15:14 GMT
From: Jordan Hiller <hiller@email.com>
Subject: Re: regexp in substr?
Message-Id: <378E3346.FE546EF0@email.com>
substr($_, index($_, '-'));
Joshua Harr wrote:
>
> I need to create a substring where the offset is dependent on a regular
> expression. The following won't work of course, but it may give a
> better idea of what I am trying to do:
>
> $E = substr($_,/-/);
>
> so here, I want to return the substring of $_ from the first '-'
> character to the end of the string. Can anyone help me out here? Much
> thanks.
--
Jordan Hiller (hiller@email.com)
JavaScript and Perl programs for
making online tests and quizzes:
http://web-shack.hypermart.net/quiz.html
------------------------------
Date: Thu, 15 Jul 1999 19:28:28 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: regexp in substr?
Message-Id: <378e33da.7114600@news.skynet.be>
Joshua Harr wrote:
>I need to create a substring where the offset is dependent on a regular
>expression. The following won't work of course, but it may give a
>better idea of what I am trying to do:
>
>$E = substr($_,/-/);
>
>so here, I want to return the substring of $_ from the first '-'
>character to the end of the string. Can anyone help me out here? Much
>thanks.
So you want the offset of the first '-' in the string? You could check
the length of $`, i.e. the substring on the left of the match, but I
wouyldn't do that because it will slow EVERY regex in your script, or in
any used module, down. BTW the full code would be
/-/ and $E = substr($_,length $`);
A better idea, especially if you're only interested in FIXED substrings,
and don't really need regexes, is index(). (This is the Perl equilvalent
of BASIC's instr.)
$E =substr($_, index($_,'-'));
Be aware of the generation of a warning if there is no '-' in $_.
But, why not try to match "a hyphen and everything following it"?
($E) = /(-.*)/s;
(The //s makes "." match newlines too.)
HTH,
Bart.
------------------------------
Date: Thu, 15 Jul 1999 12:18:51 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: regexp in substr?
Message-Id: <MPG.11f7d3fb71086b31989cda@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <378DC850.D69CCF3F@titan.byu.edu> on Thu, 15 Jul 1999
05:38:56 -0600, Joshua Harr <josh@titan.byu.edu> says...
> I need to create a substring where the offset is dependent on a regular
> expression. The following won't work of course, but it may give a
> better idea of what I am trying to do:
>
> $E = substr($_,/-/);
>
> so here, I want to return the substring of $_ from the first '-'
> character to the end of the string. Can anyone help me out here? Much
> thanks.
$E = substr $_, index $_, '-';
This has nothing to do with regular expressions. If you want to use
regular expressions, use regular expressions. :-)
($E) = /(-.*)/s;
BTW, upper-case names for 'variables' look wrong, even if they are only
one letter long.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 15 Jul 1999 13:44:59 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Tcl-to-Perl translator?
Message-Id: <MPG.11f7e822e5573fc0989cdb@nntp.hpl.hp.com>
I am about to inherit a pile of Tcl code, whose primary purpose is to
produce SQL. (Tk isn't involved at all.) Rather than learn Yet Another
Language, I though it might be best to translate the stuff into Perl,
from which I can adapt, maintain and improve it.
I've done some net surfing, and haven't come up with anything. The Tcl
FAQ is not interested in such a subject, of course. :-)
Does anyone have any experience, suggestions or code that they can
share?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 15 Jul 1999 16:06:35 -0400
From: Joe Rocklin <Joe.Rocklin@sdrc.com>
Subject: TIe::IxHash
Message-Id: <378E3F4A.FF76AADA@sdrc.com>
This is a multi-part message in MIME format.
--------------88F137D6D524C89135A7A9F8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Has anyone ever used this module to print the contents of a hash in
insertion order? I try it, but it doesn't seem to work.
--Joe
--------------88F137D6D524C89135A7A9F8
Content-Type: text/x-vcard; charset=us-ascii;
name="Joe.Rocklin.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Joe Rocklin
Content-Disposition: attachment;
filename="Joe.Rocklin.vcf"
begin:vcard
n:Rocklin;Joe
x-mozilla-html:TRUE
org:SDRC
adr:;;;;;;
version:2.1
email;internet:Joe.Rocklin@sdrc.com
x-mozilla-cpt:;1344
fn:Joe Rocklin
end:vcard
--------------88F137D6D524C89135A7A9F8--
------------------------------
Date: Thu, 15 Jul 1999 15:17:42 -0400
From: "c.s." <cs2400@hotmail.com>
Subject: Re: Tiny error in perlfaq5
Message-Id: <932066335.461.93@news.remarQ.com>
>The odds of this being precisely 0 are a lot less than 1/1000.
>Hint: 0.00001 is not 0.
Quite true :-)
Though, it *could* happen....
------------------------------
Date: Thu, 15 Jul 1999 19:17:14 GMT
From: John.Borwick@sas.com (John Borwick)
Subject: Re: Tiny error in perlfaq5
Message-Id: <3796323e.25347918@newshost.unx.sas.com>
On 15 Jul 1999 12:37:47 -0700, Tom Christiansen <tchrist@mox.perl.com>
wrote:
>You say number, but you mean integer -- which is wrong.
OK; I didn't know what was going on.
Please trust that I did test some code before I posted. When I loop
for 20 or 30 thousand times, an error occurs.
#!/usr/local/bin/perl5 -w
use strict;
my $retval;
for(my $c=0;$c<30000;$c++) {
$retval = 1/rand(1000);
}
So, what could be done to ensure that rand(1000) never returns 0?
Also, how often will rand(1000) actually return zero? Is this a one
in sizeof double case? If I could hazard a guess, I'd say that an
error occurs consistently over 2**16 (65536) iterations.
--
John Borwick
------------------------------
Date: 15 Jul 1999 13:53:46 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Tiny error in perlfaq5
Message-Id: <378e3c4a@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
jobosw@unx.sas.com writes:
:So, what could be done to ensure that rand(1000) never returns 0?
rand(1000)||1
:Also, how often will rand(1000) actually return zero? Is this a one
:in sizeof double case? If I could hazard a guess, I'd say that an
:error occurs consistently over 2**16 (65536) iterations.
Sounds like you don't have enough randbits in the function you
had perl use for its rand function. I can't reproduce that.
--tom
--
Sometimes when you fill a vacuum, it still sucks. --Rob Pike
------------------------------
Date: Thu, 15 Jul 1999 19:57:48 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Tiny error in perlfaq5
Message-Id: <378f3b38.287834894@nntp.ix.netcom.com>
On Thu, 15 Jul 1999 17:13:53 GMT, John.Borwick@sas.com (John
Borwick) wrote:
>On 15 Jul 1999 10:59:02 -0700, Tom Christiansen <tchrist@mox.perl.com>
>wrote:
>
>>:The code $hits = int( (time() - 850_000_000) / rand(1_000) );
>>:will occasionally generate a division by zero error.
>>
>>Either you don't know what rand(1_000) does, or else
>>you have a remarkably sparse notion of occasionally. :-)
>
>rand(1000) will return a number in the range 0..999, so if rand is
>truly random then approximately every thousand times the function is
>called there will be a division by zero error. There would be no
>error with
>
>int( (time() - 850_000_000 / ( rand(1_000) + 1 ) );
rand(1000) returns a ***fractional number*** in the range [0,
1000). If the documentation is correct (and I have no reason to
believe otherwise) division by 0 is possible but should be very
much less frequent than 1 per 1000 calls.
--
Michael M Rubenstein
------------------------------
Date: Thu, 15 Jul 1999 20:11:05 GMT
From: John.Borwick@sas.com (John Borwick)
Subject: Re: Tiny error in perlfaq5
Message-Id: <37973fc9.28815184@newshost.unx.sas.com>
On 15 Jul 1999 13:53:46 -0700, Tom Christiansen <tchrist@mox.perl.com>
wrote:
>Sounds like you don't have enough randbits in the function you
>had perl use for its rand function. I can't reproduce that.
Here's some information about my version of Perl.
My entire program was posted before; the rand function called was the
default function, to the best of my knowledge.
ksh> perl -V:randbits
randbits='15';
ksh> perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
Platform:
osname=hpux, osvers=10, archname=PA-RISC
uname='hp-ux arch1020 b.10.20 a 9000782 2009509931 two-user
license '
hint=previous, useposix=true, d_sigaction=define
bincompat3=y useperlio=undef d_sfio=undef
Compiler:
cc='/opt/ansic/bin/cc', optimize='-O', gccversion=
cppflags='-D_HPUX_SOURCE -Aa -I/usr/local/include +DAportable
+Onolimit'
ccflags ='-D_HPUX_SOURCE -Aa -I/usr/local/include +DAportable
+Onolimit'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib/pa1.1 /lib /usr/lib /usr/ccs/lib
libs=-lnet -lnsl_s -lndbm -ldld -lm -lc -lndir -lcrypt
libc=/lib/libc.sl, so=sl
useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-B,deferred '
cccdlflags='+z', lddlflags='-b -L/usr/local/lib'
Characteristics of this binary (from libperl):
Built under hpux
Compiled at Jul 21 1998 13:05:39
@INC:
/usr/local/lib/perl5/PA-RISC/5.00404
/usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/PA-RISC
/usr/local/lib/perl5/site_perl
.
--
John Borwick
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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 V9 Issue 157
*************************************