[15723] in Perl-Users-Digest
Perl-Users Digest, Issue: 3136 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 23 14:15:51 2000
Date: Tue, 23 May 2000 11:15:29 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <959105729-v9-i3136@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 23 May 2000 Volume: 9 Number: 3136
Today's topics:
Re: join " ", do {$x++}, do {$x++}, do {$x++}; <red_orc@my-deja.com>
Re: join " ", do {$x++}, do {$x++}, do {$x++}; <Tbone@pimpdaddy.com>
Re: join " ", do {$x++}, do {$x++}, do {$x++}; <Tbone@pimpdaddy.com>
Re: join " ", do {$x++}, do {$x++}, do {$x++}; <Tbone@pimpdaddy.com>
Re: join " ", do {$x++}, do {$x++}, do {$x++}; <Tbone@pimpdaddy.com>
Re: join " ", do {$x++}, do {$x++}, do {$x++}; (Bart Lateur)
Re: LWP Module and error 500 <rootbeer@redcat.com>
Measuring excecution times in milliseconds <tim.blair.nospam@ntli.net>
Re: Measuring excecution times in milliseconds <sariq@texas.net>
Re: Measuring excecution times in milliseconds nobull@mail.com
Re: Measuring excecution times in milliseconds <samay1NOsaSPAM@hotmail.com.invalid>
Memory Leak With ODBC.pm?, IIS4, ActivePerl-5.6.0.613 <Roland@psychenet.co.uk>
Re: Modules - Newbie question <simon@fsite.com>
Re: Modules - Newbie question <jeff@vpservices.com>
Re: Modules: creating man pages <sweeheng@usa.net>
Re: my algorythms suck <samay1NOsaSPAM@hotmail.com.invalid>
Re: my algorythms suck (Bart Lateur)
Re: Newbie: How to completely uninstall perl (W32) <rootbeer@redcat.com>
Re: Newbie: How to completely uninstall perl (W32) <camerond@mail.uca.edu>
Re: Norton identifies Perl as a worm (Randal L. Schwartz)
Re: PerlMUD + Curses + Nethack??? <rootbeer@redcat.com>
Re: pl2exe missing from ActivePerl <rootbeer@redcat.com>
Re: read in a file and delete first 8 lines <jhelman@wsb.com>
Re: Recommendations on a Perl/MySQL book or chapter? <camerond@mail.uca.edu>
Re: Recommendations on a Perl/MySQL book or chapter? <jeff@vpservices.com>
Re: Recommendations on a Perl/MySQL book or chapter? (brian d foy)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 23 May 2000 15:03:31 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: join " ", do {$x++}, do {$x++}, do {$x++};
Message-Id: <8ge6jn$inb$1@nnrp1.deja.com>
In article <8gcstu$2hiq$1@news.enteract.com>,
Tbone@pimpdaddy.com wrote:
> I seem to have lost the ability to RTFM... could someone point me
> to where it says that the above (see subject line) will guarantedly
> produce "1 2 3"?
>
>
There should be no such guarantee, since it would depend on the initial
value of $x. if $x == 5 prior to the join, it should produce "5 6 7".
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 23 May 2000 15:38:38 GMT
From: Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com>
Subject: Re: join " ", do {$x++}, do {$x++}, do {$x++};
Message-Id: <8ge8lu$13me$1@news.enteract.com>
bart.lateur@skynet.be writes:
> Comma Operator
>
> Binary "," is the comma operator. In scalar context it evaluates
> its left argument, throws that value away, then evaluates its
> right argument and returns that value. This is just like C's
> comma operator.
>
> In list context, it's just the list argument separator, and
> inserts both its arguments into the list.
Thanks for the pointer.
>Hmmm... that isn't very explicit, isn't it? In scalar context, it is
>garanteed to be executed from left to right, but in list context, it's
>not said in so many words.
>
>Just a gap in the docs?
I sort-of hope so. But then what's the explanation of Larry's
counterexample? (I.e. I hope it's to do with aliasing of @_
somehow.)
------------------------------
Date: 23 May 2000 15:51:41 GMT
From: Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com>
Subject: Re: join " ", do {$x++}, do {$x++}, do {$x++};
Message-Id: <8ge9ed$14bq$1@news.enteract.com>
bart.lateur@skynet.be writes:
>[see original post]
It's a lot clearer now, thanks. But not crystal-clear, at least to
me. Maybe "sequential or not" is the wrong question. Let me change
it:
Given that $x++ in the above is not an lvalue, is there a guarantee
that the statement will produce "0 1 2"?
(This is in contrast with e.g. (do {$x}, do {$x++}), since $x is an
lvalue.)
--
Tushar Samant
------------------------------
Date: 23 May 2000 16:04:59 GMT
From: Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com>
Subject: Re: join " ", do {$x++}, do {$x++}, do {$x++};
Message-Id: <8gea7b$15c6$1@news.enteract.com>
tjla@guvfybir.qlaqaf.bet writes:
>Probably not...In C (and presumably perl) they have
>this rule that goes something like (paraphrased) "don't chang the value of
>a variable more than once in an expression" or something (I forget exactly).
>I know I'm not explaining this very well. Look basically you can't do an
>expression like this "$i = $i++" because it will give you undefined
>results. The reason is you are assigning to $i twice and this confuses
>compilers. The same goes for the function call above where you are
>assigning multiple times to $x in the one expression. eg if you did a
>function call like this "f($i++, $i++)" where $i originally had the
>value 7, then the function might be called like f(7,7), f(7,8), f(8,7)
>or whatever. I don't really understand why this happens. I suggest
>having a look at the comp.lang.c FAQ for a better explanation.
The long and short of it seems to be that "sequential execution" is not
guaranteed by the language in the examples above (and possibly not even
well-defined without extra machinery). However, neither of the examples
really pertains to the comma operator, IMO.
The case of Perl is different since the distinction between "argument
list" to a function and a list is blurry.
------------------------------
Date: 23 May 2000 16:06:10 GMT
From: Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com>
Subject: Re: join " ", do {$x++}, do {$x++}, do {$x++};
Message-Id: <8gea9i$15e4$1@news.enteract.com>
red_orc@my-deja.com writes:
>In article <8gcstu$2hiq$1@news.enteract.com>,
> Tbone@pimpdaddy.com wrote:
>> I seem to have lost the ability to RTFM... could someone point me
>> to where it says that the above (see subject line) will guarantedly
>> produce "1 2 3"?
>
>
>There should be no such guarantee, since it would depend on the initial
>value of $x. if $x == 5 prior to the join, it should produce "5 6 7".
Sorry, I meant--but didn't say--that $x is given to be 1.
------------------------------
Date: Tue, 23 May 2000 17:44:37 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: join " ", do {$x++}, do {$x++}, do {$x++};
Message-Id: <392bc2d2.2333433@news.skynet.be>
Intergalactic Denizen of Mystery wrote:
>The long and short of it seems to be that "sequential execution" is not
>guaranteed by the language in the examples above
No, it IS sequential in the examples above. Only, the assigned value is
passed by reference, so changing the variable will also change the copy.
Witness:
$x = 1;
*y = *x;
print "$y\n"; # 1
$x++;
print "$y\n"; # 2
Changing $x also changes $y, because they point to the same variable.
print $x++, $x++;
is a very similar case. The second increment also changes the first
parameter, because they point to the same value.
--
Bart.
------------------------------
Date: Tue, 23 May 2000 09:42:20 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: LWP Module and error 500
Message-Id: <Pine.GSO.4.10.10005230942050.23375-100000@user2.teleport.com>
On Tue, 23 May 2000, Franck Lalane wrote:
> it print "500", which I guess is the error code (according to the
> documentation)
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.cpan.org/
http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
http://www.cpan.org/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 23 May 2000 16:20:25 +0100
From: "Tim Blair" <tim.blair.nospam@ntli.net>
Subject: Measuring excecution times in milliseconds
Message-Id: <ihxW4.626$E11.7690@news6-win.server.ntlworld.com>
Hi there,
Is there any nice and easy way to measure how long a section of code takes
in milliseconds? I can find plenty of way do get the time in seconds, but
none in milliseconds.
Even getting the system time in ms would be useful (once at the beginning,
once at the end, minus to find the difference), but I can't find any way to
do this...
Can anyone help?
Thanks,
Tim.
------------------------------
Date: Tue, 23 May 2000 10:23:12 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Measuring excecution times in milliseconds
Message-Id: <392AA260.A10F342D@texas.net>
Tim Blair wrote:
>
> Hi there,
>
> Is there any nice and easy way to measure how long a section of code takes
> in milliseconds?
Please check the FAQ *before* posting.
perldoc -q profile
- Tom
------------------------------
Date: 23 May 2000 17:59:26 +0100
From: nobull@mail.com
Subject: Re: Measuring excecution times in milliseconds
Message-Id: <u9ya51kxsh.fsf@wcl-l.bham.ac.uk>
"Tim Blair" <tim.blair.nospam@ntli.net> writes:
> I can find plenty of way do get the time in seconds, but none in
> milliseconds.
In addition to other FAQ entries see: "How can I measure time under a
second?"
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 23 May 2000 10:25:36 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Re: Measuring excecution times in milliseconds
Message-Id: <33c2313d.cf031681@usw-ex0104-087.remarq.com>
If you really want to test some regex or program execution time
for faster version, I would suggest use Benchmark.
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Tue, 23 May 2000 17:48:22 +0100
From: "Roland Corbet" <Roland@psychenet.co.uk>
Subject: Memory Leak With ODBC.pm?, IIS4, ActivePerl-5.6.0.613
Message-Id: <392ab707.0@news.myratech.net>
We have a server that runs a number of websites, using PerlIS.dll for use
with IIS4.
We are using the standard Win32ODBC module that is downloadable with PPM
that comes with Active Perl 5.2.2. Over time the memory used by the serevr
increases. I believe this has resulted in the server crashing out on a
number of occasions. The process that eats away at the memory is
inetinfo.exe.
I have read an article that says a Memory leak is belived to be in the ODBC
module. I enclose the article below:
--8<-------------------------------------------------------------
Subject: Re: Memory leak creating and destroying COM objects
From: "Randall Burke" <randall_burke@pantechsolutions.com>
Date: Fri, 31 Mar 2000 12:14:35
X-Message-Number: 17
I found out where the trouble was and thought I'd post the answer ...
The Perl interpreter is around 5MB or so. Whenever a PerlCOM object is
created it uses up at least that much memory, but it seems to also free up
the memory completely when the COM object is destroyed - no leak there.
I tracked this memory leak problem down finally after I discovered it was
the Perl ODBC driver I was using inside the COM object. It was leaking the
640K per create/destroy cycle (like the ODBC module was not being
unloaded). The ODBC module that comes with ActivePerl 522 seems to have a
leak so I changed it out with a newer beta
ODBC driver (19991221.zip) from roth.net and the problem has gone away.
Jack Gudenkauf wrote:
It's probably not a memory leak at all, but the fact that Perl is
bloated
because it includes the entire interpreter.
--8<-------------------------------------------------------------
I have tried replacing the ODBC module with this beta version, but it looks
like it no longer works with our scripts that were writen for a previous
version. An example of this is when a query is made to the database, the
column headings can be returned, however the data is not displayed. Querys
can be made successfully, and return the correct number of rows. However,
the data is not available. Also, while attempting to run our scripts,
although they do not appear to run correctly - i.e. returning no data, they
appear to 'leak' memory, as with the other version. They also seem to run
better from the comand line rather than through a browser and IIS.
Ideally, we would like to run the latest version of Active Perl,
ActivePerl-5.6.0.613
It appears that the ODBC module with this version doesn't like our scripts
either. I have tried installing the beta ODBC module with the latest
version of Perl, with the result of the ODBC module not working at all. I
have also tried using PPM with the latest version of perl (after applying
the hotfix), but the Win32 module does not seem to be available, even after
adding the roth repository using the SET command.
Could anyone point me in the directions of what is going on here and to
possible solutions - eg. how to install the latest version of perl, with and
ODBC version that doesn't 'leak' memory and works with IIS4 on our NT
Server.
Many thanks in anticipation of your time and help.
Regards
Roland Corbet
Systems Administrator & Developer
Psyche Solutions LTS
------------------------------
Date: Tue, 23 May 2000 15:12:38 +0100
From: "Simon McGregor" <simon@fsite.com>
Subject: Re: Modules - Newbie question
Message-Id: <392a91a4.0@shiva.ukisp.net>
Jeff Zucker <jeff@vpservices.com> wrote in message
news:3929D94B.66FF6513@vpservices.com...
> Simon McGregor wrote:
[...]
> > And can someone explain to me in plain language what the difference
between
> > "use" and "require" is? I can't quite seem to see what "use" is doing
(and
> > in general I haven't got my head around the way Perl does object
> > orientation).
>
> If the module has functions which are exported, then "use" imports them
> but "require" does not. That is to say if a module foo defines a
> function bar() and exports that function, this would work:
>
> use foo;
> &bar();
>
> and this would not:
>
> require "foo.pm";
> &bar();
OK... But if I do
require "foo.pl";
&bar();
that seems to work fine, providing that bar() is defined in foo.pl - what's
the difference?
[...]
> Again, bazically, not having root priveledges is not a bar to fooling
> around with modules. If you can install scripts on those sites, there
> is probably no reason you can't also install modules there as well.
We "install" our scripts by simply FTP'ing them into the cgi-bin directory.
Can the same be done with a module, or does installation do critical things
which can't be reproduced by simply copying a file?
>
> --
> Jeff
Thanks, and sorry for being so dense about this.
Simon
------------------------------
Date: Tue, 23 May 2000 10:35:02 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Modules - Newbie question
Message-Id: <392AC146.6299051C@vpservices.com>
Simon McGregor wrote:
> OK... But if I do
>
> require "foo.pl";
> &bar();
>
> that seems to work fine, providing that bar() is defined in foo.pl - what's
> the difference?
The difference between a simple required file and a module is the
"package" statement in the module that declares a different namespace.
You might want to look at MJD's tutorial on modules at
http://www.plover.com/~mjd/perl/Hello/
> We "install" our scripts by simply FTP'ing them into the cgi-bin directory.
> Can the same be done with a module, or does installation do critical things
> which can't be reproduced by simply copying a file?
That depends on the module. Those that do not depend on compiled C code
can simply be dumped into a directory via FTP. Ones that require
compilation would have to be compiled on a similar system to the one you
are FTPing to before transferring them.
--
Jeff
------------------------------
Date: Tue, 23 May 2000 23:18:03 +0800
From: "Swee Heng" <sweeheng@usa.net>
Subject: Re: Modules: creating man pages
Message-Id: <8ge750$kfo$1@mawar.singnet.com.sg>
Tom Phoenix <rootbeer@redcat.com> wrote in message
news:Pine.GSO.4.10.10005221559210.23375-100000@user2.teleport.com...
> On Mon, 22 May 2000, A Pietro wrote:
> > But how can I read the manual page for MyModule::Config?
If man is properly configured, the correct thing to use is "man
MyModule::Config" rather than "man MyModule" unless, of course, there is a
MyModule.pm some where.
> Have you tried perldoc? That should work, although you may need to tell it
> where your module is.
Yup. The other alternative is "perldoc MyModule::Config". Useful for viewing
source too, when invoked as "perldoc -m MyModule::Config".
------------------------------
Date: Tue, 23 May 2000 10:28:01 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Re: my algorythms suck
Message-Id: <2e967b30.cf8b3e53@usw-ex0104-087.remarq.com>
What's your alogorithm??
Post yours, and we may work on it..
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Tue, 23 May 2000 17:46:23 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: my algorythms suck
Message-Id: <392cc3b6.2561317@news.skynet.be>
klidge wrote:
>so i have an index file for a forum i want to create on the web
>
>1?1?0?subject 1?nick1?10?02?00
>2?2?0?subject 2?nick2?15?02?00
>3?2?2?subject 2-1?nick1?23?02?00
>4?3?0?subject 3?nick3?13?03?00
It looks like you need
@fields = split /\?/;
--
Bart.
------------------------------
Date: Tue, 23 May 2000 09:26:45 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Newbie: How to completely uninstall perl (W32)
Message-Id: <Pine.GSO.4.10.10005230923200.23375-100000@user2.teleport.com>
On Mon, 22 May 2000, Thomas C. Jones wrote:
> Does anyone have any suggestions on how to completely remove Perl?
The easiest way, in general, is to completely restore your system from the
backup tapes.
If you're willing to only _partially_ get back to where you were before
you started installing, you may be able to do so without the help of
backup tapes, of course.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 23 May 2000 12:59:47 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Newbie: How to completely uninstall perl (W32)
Message-Id: <392AC713.27C1B8A3@mail.uca.edu>
"Thomas C. Jones" wrote:
>
> Hello,
>
> Pardon the newbie question.
>
> In my abortive attempt to install ActiveState's latest Perl onto Win32 I
> seemed to have foobar'd something and now some scripts fail with cryptic
> messages. I think it may have something to do with the back-slash
> forward-slash dichotomy of Win32.
>
> In any case, I'd like to get back, back to where I once belonged. I
> would like to remove all traces of this god-foresaken version of Perl
> and all previous versions for that matter and start from scratch.
>
> Does anyone have any suggestions on how to completely remove Perl?
Have you tried "Add/Remove Programs" from the Control Panel?
Then, I'd suggest 522 (5.00503). It works well, and seems to be quite
stable. You have to search around for it on the website a bit, though.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: 23 May 2000 09:15:58 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Norton identifies Perl as a worm
Message-Id: <m1itw5uts1.fsf@halfdome.holdit.com>
>>>>> "Kiera" == Kiera <kiera@nnickee.com> writes:
>> The latest version of Norton now identifies the Perl FAQ
>> file as having the Love Bug worm in it.
Kiera> Odd. I just updated my virus defs for NA two days ago. The scan
Kiera> didn't have any problems on the partition where perl is installed, but
Kiera> it did barf on the next partition - seemingly on one of my .pl
Kiera> scripts. It didn't say the file was infected, it just froze in place
Kiera> on that script, 3 separate times.
"Perl v. Norton"... round 1 goes to Norton. Round 2 goes to Perl. :)
--
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: Tue, 23 May 2000 09:13:55 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: PerlMUD + Curses + Nethack???
Message-Id: <Pine.GSO.4.10.10005230912140.23375-100000@user2.teleport.com>
On 22 May 2000, Adam Trace Spragg wrote:
> I'm not sure if I know how to say what I'm trying to say. I guess
> "how well does a Curses based application run over an internet link?"
Depends upon the speed of the link, in general, but probably just fine.
It's made to run over an Internet connection, after all. But I can't
promise that it'll be trivial to get it working in your situation, of
course.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 23 May 2000 09:07:16 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: pl2exe missing from ActivePerl
Message-Id: <Pine.GSO.4.10.10005230905520.23375-100000@user2.teleport.com>
On Tue, 23 May 2000, Tk Soh wrote:
> > > I have been looking for the pl2exe utility which, per the FAQ, should be
> > > bundled with the installation,
> >
> > Can you tell me where in the FAQ you read this?
> ---------
> ./faq/Windows/ActivePerl-Winfaq4.html:
> <P>The pl2exe utility is similar to pl2bat, but it puts an executable
> header on your perl script, that have been run through pl2exe.</P>
>
> ./faq/Windows/ActivePerl-Winfaq5.html:
> file association feature. You can use pl2exe or pl2bat to convert a Perl
> script to an executable or
> ---------
Can you tell me where in the FAQ you read that pl2exe should be bundled
with the installation?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 23 May 2000 15:51:46 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: read in a file and delete first 8 lines
Message-Id: <392AA937.8FF74DC0@wsb.com>
Larry Rosler wrote:
>
> In article <39296F81.EB320FD1@wsb.com> on Mon, 22 May 2000 17:33:19 GMT,
> Jeff Helman <jhelman@wsb.com> says...
>
> ...
>
> > Okay, based on this it looks like you want to extract the <PRE>...</PRE>
> > segment, and include the enclosing <PRE> tags. How 'bout this:
> >
> > ## EFFICIENTLY READ THE FILE INTO SCALAR $File
> > open INF, "whatever.html"; ## YOUR FILENAME HERE
>
> You omitted the test and diagnostic for failure to open the file!
>
Yes, I did. I also omitted the check to make sure that the read call
below didn't fail. I also didn't check to see whether the file even had
<PRE></PRE> tags. I was leaving bullet-proofing as an exercise for the
reader.
> > binmode INF; ## IF YOU ARE RUNNING ON WINDOWS
>
> No. The file should be handled as a text file.
>
The only problem with this is that on Windows, land of the \r\n
newlines, the -s file test operator reports the size of the file in
bytes. However, read reports that the \r\n construct is only one byte
long. This makes error-checking a bitch since a successful read reports
that it read fewer bytes than -s indicates. And while a sucessive read
will report a 0 (end-of-file condition), I'll never feel totally secure
that I got it all. Sorry, but I'm paranoid.
> > read INF, $File, -s INF;
>
> Well, that certainly seems to be the most efficient way. :-)
>
Actually, sysread is even better, but I was trying to conserve typing.
> > close INF;
> >
> > ## REGEX TO LOSE ANYTHING AROUND THE <PRE></PRE> TAGS
> > $File =~ s/.+<PRE>.+?</PRE>.+/$1/ie;
> >
> > Hope this helps,
>
> No, it won't help, for several reasons.
>
> 1. It won't compile, because of the unescaped slash in the second tag.
> Use alternate delimiters.
>
Oops. Totally and utterly correct. I can only plead sleep deprivation.
:)
> 2. It won't match, because '.' doesn't match a newline. Use the /s
> modifier.
>
How the hell did I get /e when I meant /s? See above...
> 3. There are no parentheses in the regex to capture what is matched.
>
Geez. Was I drinking...?
> 4. It will produce chaos, because you have specified that the captured
> string be evaluated as a Perl expression. Drop the /e modifier.
>
> Untested (because I wouldn't recommend this approach in any case):
>
> $File =~ s%.+(<PRE>.+?</PRE>).+%$1%is;
>
> It would be a good idea to enhance the value of your intended
> helpfulness by posting only tested code, unless explicitly stated
> otherwise.
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
--
----------------------------------------------------------------
Jeff Helman Product Manager -- Internet Services
jhelman@wsb.com CCH Washington Service Bureau
----------------------------------------------------------------
99 little bugs in the code, 99 bugs in the code.
Fix one bug, compile again, 100 little bugs in the code.
100 little bugs in the code, 100 bugs in the code.
Fix one bug, compile again, 101 little bugs in the code...
----------------------------------------------------------------
------------------------------
Date: Tue, 23 May 2000 10:27:26 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Recommendations on a Perl/MySQL book or chapter?
Message-Id: <392AA35E.647675DE@mail.uca.edu>
brian d foy wrote:
>
> In article <39295f07.0@news.pacifier.com>, Neil <neil@shell.pacifier.com> wrote:
>
> >Dave Cross <dave@dave.org.uk> wrote:
> >
> >> Never thought I'd hear myself say this, but the New Riders book
> >> suggested by Jeff is _much_ better than the O'Reilly one.
>
> >Are there actual errors in the O'Reilly book or is that New Riders
> >book just better written?
>
> IMO, the O'Reilly book is not only poorly written, but leaves out
> stuff. the parts that the mysql docs do not cover are much better
> found in Programmin the Perl DBI. otherwise, the mysql docs are
> far superior to the O'Reilly book.
Okay, brian, you've got me (potentially) confused now, since there are
two O'Reilly books here:
Programming the Perl DBI (Descartes & Bunce)
MySQL and mSQL (Nutshell Series)(Yarger, R****, King)
Please clarify to remove ambiguity your takes on both of these. I'm
reasonably sure I know about the latter, but might you comment on the
former (is it all good, or only for the parts the mysql docs leave
out?), just to make sure I'm reading you right. Thanks.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Tue, 23 May 2000 09:01:12 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Recommendations on a Perl/MySQL book or chapter?
Message-Id: <392AAB48.E4AE5D4B@vpservices.com>
Cameron Dorey wrote:
>
> brian d foy wrote:
> >
> > In article <39295f07.0@news.pacifier.com>, Neil <neil@shell.pacifier.com> wrote:
> >
> > >Dave Cross <dave@dave.org.uk> wrote:
> > >
> > >> Never thought I'd hear myself say this, but the New Riders book
> > >> suggested by Jeff is _much_ better than the O'Reilly one.
> >
> > >Are there actual errors in the O'Reilly book or is that New Riders
> > >book just better written?
> >
> > IMO, the O'Reilly book is not only poorly written, but leaves out
> > stuff. the parts that the mysql docs do not cover are much better
> > found in Programmin the Perl DBI. otherwise, the mysql docs are
> > far superior to the O'Reilly book.
>
> Okay, brian, you've got me (potentially) confused now, since there are
> two O'Reilly books here:
>
> Programming the Perl DBI (Descartes & Bunce)
>
> MySQL and mSQL (Nutshell Series)(Yarger, R****, King)
>
> Please clarify to remove ambiguity your takes on both of these. I'm
> reasonably sure I know about the latter, but might you comment on the
> former (is it all good, or only for the parts the mysql docs leave
> out?), just to make sure I'm reading you right. Thanks.
Since I was the one who mentioned the Descartes and Bunce and the DuBois
books but didn't mention the Yarger et. al book, let me comment:
Descartes and Bunce is a must-have for anyone working with any kind of
database in Perl. If one is also working with MySQL, then the DuBois
book is very useful. The Yarger et. al book actually has some nice
summaries of which features of DBI/DBDs are supported in MySQL and mSQL
but it also unfortunately has some poor examples of Perl coding so is
not first on my list to recommend to new users. Uri has written an
informative review of the Yarger et. al. book. I am fairly certain that
brian's reference to "the O'Reilly book" was refering to Yarger et. al.,
not to Descartes and Bunce, but I am sure he will let us know :-)
--
Jeff
------------------------------
Date: Tue, 23 May 2000 12:10:13 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Recommendations on a Perl/MySQL book or chapter?
Message-Id: <brian-ya02408000R2305001210130001@news.panix.com>
In article <392AA35E.647675DE@mail.uca.edu>, Cameron Dorey <camerond@mail.uca.edu> posted:
> brian d foy wrote:
> > IMO, the O'Reilly book is not only poorly written, but leaves out
> > stuff. the parts that the mysql docs do not cover are much better
> > found in Programmin the Perl DBI. otherwise, the mysql docs are
> > far superior to the O'Reilly book.
>
> Okay, brian, you've got me (potentially) confused now, since there are
> two O'Reilly books here:
i'm sorry - the thread was talking about the MySQL book with the
pink spine, but i didn't make that clear in my response.
> Programming the Perl DBI (Descartes & Bunce)
best book O'Reilly has published recently. see my full review
at www.perl.org.
> MySQL and mSQL (Nutshell Series)(Yarger, R****, King)
sucks, IMO, and is beyond help. the original docs are much
better for both products.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
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 V9 Issue 3136
**************************************