[12966] in Perl-Users-Digest
Perl-Users Digest, Issue: 376 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 5 00:07:17 1999
Date: Wed, 4 Aug 1999 21:05:08 -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 Wed, 4 Aug 1999 Volume: 9 Number: 376
Today's topics:
5.005.03 compile problem (Steve Manes)
Re: [offtopic]RE:Quot St and the Jeop Gm <llornkcor@llornkcor.com>
Cache Problems <master@openendon.com>
Re: Cannot get pws to run perl scripts -- GOT IT!!! <the.werners@mcleodusa.net>
Re: Cant seem to turn off cashing??? (Martien Verbruggen)
Re: Cookbk p228 - sysopen error (Martien Verbruggen)
Re: eliminating a / in a word <uri@sysarch.com>
Re: Get Executables path (Martien Verbruggen)
Re: hash ???- sort/changing keys. (Steve Manes)
Re: Hash <dheera@my-deja.com>
how to add module? (gem)
patten matching ming@tickets.com
Re: patten matching (Eric Bohlman)
Re: patten matching <jeffp@crusoe.net>
Re: patten matching karl_s_eiringer@my-deja.com
Re: patten matching (Larry Rosler)
Re: patten matching (Steve Manes)
Re: PDF file not rendered on Explorer (Martien Verbruggen)
Re: Perl vs HTML (Martien Verbruggen)
Re: Perl vs HTML (Martien Verbruggen)
Re: Perl vs HTML (Martien Verbruggen)
read, write and sysread, syswrite? <sunyueng@scmp.com>
Re: read, write and sysread, syswrite? (Steve Manes)
Re: regexp - subtitute everything than (Larry Rosler)
Re: regexp can be your friend <uri@sysarch.com>
Re: Repetition in RE substitutions <uri@sysarch.com>
Search algorithm in Perl <dheera@my-deja.com>
Re: unus sed leo (Larry Rosler)
Re: while loop teminates too early (Martien Verbruggen)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 05 Aug 1999 02:41:27 GMT
From: smanes@NOSPAM.HEREmagpie.com (Steve Manes)
Subject: 5.005.03 compile problem
Message-Id: <37a8f707.216855666@news.panix.com>
I had this compiled and running fine under Linux 2.0.34. Yesterday, I
got Dell P3 for the network and installed Redhat 6.0 on it for a
starter system. I usually spend the next several days pulling down
sources are recompiling the kernel and all the critical stuff. The
first to go after the upgrade to Linux 2.2.10 was Perl because I know
from reputation that Redhat's build is problematic with mod_perl.
Actually, Perl compiles without gripes. It just fails one test in
'anydbm.t'. This test assigns a string value to a hash, h, with a
null key, i.e.
$h{''} = 'bar';
This is where the test fails:
print ($h{""} eq 'bar' ? "ok 12\n" : "not ok 12\n");
My guess is that Perl is dragging in a Redhat dbm library from
somewhere that doesn't support null keys, but I dunno. Anyone else
run across this and have a fix for it?
------------------------------
Date: 04 Aug 1999 20:19:53 -0600
From: llornkcor <llornkcor@llornkcor.com>
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <so5zynna.fsf@wind.localdomain>
>You miss the point entirely.
no, I didnt... I diverged.
--
- "Peace cannot be kept by force. It can only be achieved by
understanding."
-A. Einstein
------------------------------
Date: Thu, 05 Aug 1999 02:31:13 GMT
From: Jordan DeLozier <master@openendon.com>
Subject: Cache Problems
Message-Id: <37A8FA08.119DEC15@openendon.com>
--------------66FA23A95AE1648BFF80FA1C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I have a banner script I have been working on. It loads the images great
using the Location: $banner, This script has to be made so it does not
host the image files and it can not be SSI. When I load up an image,
then someone else loads up an image, then I hit reload, it brings up the
same banner, but a different link.
Anyone know how to fix this?
Thanks,
Jordan DeLozier
--
*************************
Openendon Top Sites
http://www.openendon.com
Top Sites Listing
*************************
--------------66FA23A95AE1648BFF80FA1C
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I have a banner script I have been working on. It loads the images great
using the Location: $banner, This script has to be made so it does not
host the image files and it can not be SSI. When I load up an image,
then someone else loads up an image, then I hit reload, it brings up the
same banner, but a different link.
<p>Anyone know how to fix this?
<p>Thanks,
<br>Jordan DeLozier
<pre>--
*************************
Openendon Top Sites
<A HREF="http://www.openendon.com">http://www.openendon.com</A>
Top Sites Listing
*************************</pre>
</html>
--------------66FA23A95AE1648BFF80FA1C--
------------------------------
Date: Wed, 4 Aug 1999 22:07:54 -0500
From: "Kevin and Andrea Werner" <the.werners@mcleodusa.net>
Subject: Re: Cannot get pws to run perl scripts -- GOT IT!!!
Message-Id: <Lc7q3.310$F22.2042@newsfeed.slurp.net>
Dude!
Try using a .plx extension instead of a .pl extension.
It worked for me, but I don't know why. Can anyone explain why .plx works
and .pl doesn't?
Kevin and Andrea Werner <the.werners@mcleodusa.net> wrote in message
news:jh5q3.176$F22.363@newsfeed.slurp.net...
> We seem to be having the same problem. I also posted a message about this
> problem (see "Help getting Perl to work on Windows 98").
>
> No one has responded to my post yet, so I'm afraid I don't have any words
of
> wisdom.
>
> I am going to keep pounding on it and will post something if I figure it
> out.
>
>
>
> 99% Energy <Spam@IsBadForTheInternet.com> wrote in message
> news:iz4q3.8563$k8.299460@newscene.newscene.com...
> > I have tried configuring the registry at
> >
> >
>
\HKEY_LOCAL_MACHINES\System\CurrentControlSet\Services\w3svc\parameters\Scri
> > pt Map
> > with the following entry: Name: .pl Data: "c:\perl\bin\perl.exe %s %s"
(I
> > also tried perlis.dll %s %s) according to the the MS Knowledge base
> article:
> > http://support.microsoft.com/support/kb/articles/Q150/6/29.asp (thanks
to
> > "elephant" jason).
> >
> > Perl script runs fine directly at the command prompt with
c:\perl\bin\perl
> > Envtest.pl -w
> > Executables can be run at the browser (example
> > http:/\localhost/cgi-bin/htimage.exe)
> > If I rename the file Envtest.pl to Envtest.txt, I can view the source at
> the
> > browser.
> >
> > What I am doing wrong?
> > Thanks in advance
> >
> > 99% Energy
> >
> >
>
>
------------------------------
Date: Thu, 05 Aug 1999 03:08:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Cant seem to turn off cashing???
Message-Id: <pe7q3.227$Qj2.8797@nsw.nnrp.telstra.net>
In article <7oaf5g$h5o$1@nn-tk001.ocn.ad.jp>,
"Scott" <codeman@gol.com> writes:
> I am working on a project in Japan at the moment and
> live in Tokyo. I am having trouble with the code as it
> keeps going to the cache and I want it to refresh on the
> first time around.
You're talking about your web browser cache, right? That has
absolutely nothing at all to do with perl. You'd be better off asking
in a group that talks about HTTP, CGI, HTML or web browsers: Somewhere
in comp.infosystems.www.* maybe.
Martien
--
Martien Verbruggen |
Interactive Media Division | +++ Out of Cheese Error +++ Reinstall
Commercial Dynamics Pty. Ltd. | Universe and Reboot +++
NSW, Australia |
------------------------------
Date: Thu, 05 Aug 1999 03:12:11 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Cookbk p228 - sysopen error
Message-Id: <fi7q3.231$Qj2.8797@nsw.nnrp.telstra.net>
In article <Pine.BSF.3.96.990804170623.29072A-100000@butterfly.inna.net>,
Jane Dudley <jdudley@inna.net> writes:
> I am testing something from the Cookbook, p. 228, and getting an error
Go back two pages. Look at the sysopens close to the top of the page.
Look _just_ above the first sysopen.
Martien
--
Martien Verbruggen |
Interactive Media Division | +++ Out of Cheese Error +++ Reinstall
Commercial Dynamics Pty. Ltd. | Universe and Reboot +++
NSW, Australia |
------------------------------
Date: 04 Aug 1999 22:13:11 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: eliminating a / in a word
Message-Id: <x7yafrgeko.fsf@home.sysarch.com>
>>>>> "e" == elephant <elephant@squirrelgroup.com> writes:
e> Matt Melton writes ..
>> Problem with eliminating a character
>> the character is /
>> ie. C/HU
>> this is equal to $h[0]
>> so that $h[0]= C/HU
>> and I want it to be CHU
>> what is a proper substitution
e> perldoc perlre
e> it's got all your answers
to eliminate a single char tr/// is better.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Thu, 05 Aug 1999 03:15:59 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Get Executables path
Message-Id: <Pl7q3.233$Qj2.8797@nsw.nnrp.telstra.net>
[Please fix your quoting style. You should first quote (only the
relevant part of) a message, then type your response.]
In article <37A8D56C.2EED1A5C@cybersurf.net>,
Matt Kennedy <mattk@cybersurf.net> writes:
[FIX QUOTING]
> Thomas Schmickl wrote:
>>
>> How can I determine (In the _BEGIN_ of the script-execution)
>> in which directory the executet perl-script is ?
>>
>
> Try:
> ###
> use Cwd;
>
> $cwd = getcwd();
Of course this does _not_ give you the directory the script is in, but
the current working directory. They are not necessarily the same, and
in fact often _not_ the same.
You could have a look at the FindBin module, maybe. Or you could use
dejanews to search for answers to this question, which comes up
regularly.
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | Can't say that it is, 'cause it ain't.
NSW, Australia |
------------------------------
Date: Thu, 05 Aug 1999 03:16:01 GMT
From: smanes@NOSPAM.HEREmagpie.com (Steve Manes)
Subject: Re: hash ???- sort/changing keys.
Message-Id: <37ac0180.219537074@news.panix.com>
On Wed, 04 Aug 1999 23:09:36 GMT, bhaskaracharya@my-deja.com wrote:
>i want to sort this hash of hashes
>
>$hash = {
> a10_msblck => {name => black},
> a5_mrjoe => { name=> joe},
> a15_msblck => {name => black},
> b10_me => {name = me},
> default => {name = default}
> };
>
The lazy way out: increase your index to two decimal places, i.e.
a05_mrjoe =>
------------------------------
Date: Thu, 05 Aug 1999 02:22:26 GMT
From: Dheera <dheera@my-deja.com>
Subject: Re: Hash
Message-Id: <7oasgq$e7b$1@nnrp1.deja.com>
Hi - have you tried
my %packet_info = Dumper( $obj );
(notice the % sign instead of the $)
Then you would be able to do packet_info{'SEQNUM'} to get its value.
If that doesn't work, might there be something similar to the qw(), but
for hashes?
my $packet_info = Dumper( $obj );
my %packet_hash = qh($packet_info);
This snippet just now is completely hypothetical - I don't know what
you'd do for qh(). But the first thing I gave you at the top of this e-
mail should work...
Hope this helps...
Dheera Venkatraman
dheera@usa.net
In article
<EAA137524E29D0D7.5EFC838768483E0F.9A8154663B7E4DA4@lp.airnews.net>,
robert@iminet.com (Robert Saunders) wrote:
> I am new to working with hashes.
>
> I have read all the documentation I can find on hashes, but I just
> don't quiet understand it yet..
>
> When I do a..
>
> my $packet_info = Dumper( $obj );
>
> Below is what it returns in the variable $packet_info.. what would be
> the easiest way to access the variables in SEQNUM.. or SESSIONID..
>
> $VAR1 = bless( {
> 'value' => {
> 'SEQNUM' => bless( {
> 'value' => 5337
> }, 'WDDX::String' ),
> 'SESSIONID' => bless( {
> 'value' => 998
> }, 'WDDX::String'
> ),
> }
> }, 'WDDX::Hash' );
>
> Robert Saunders
> robert@iminet.com
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 5 Aug 1999 03:13:35 GMT
From: yangch@meena.cc.uregina.ca (gem)
Subject: how to add module?
Message-Id: <7oavgv$k5t$1@sue.cc.uregina.ca>
Hi there,
I am using a perl version 5.003. There is no IO package installed. How can I
add it in my system? I am working under a UNIX system.
regards,
Gem
------------------------------
Date: Thu, 05 Aug 1999 01:56:53 GMT
From: ming@tickets.com
Subject: patten matching
Message-Id: <7oar11$d2r$1@nnrp1.deja.com>
Hello,
I need to compare string1 to string2, if string1 is a substring of
string2, then return truth.
for example: if I compare 'abc' agaist '123abciool' then return true.
Does anyone have any idea how to do it?
thanks for your help
ming
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 5 Aug 1999 02:32:37 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: patten matching
Message-Id: <7oat45$od8@dfw-ixnews6.ix.netcom.com>
ming@tickets.com wrote:
: I need to compare string1 to string2, if string1 is a substring of
: string2, then return truth.
:
: for example: if I compare 'abc' agaist '123abciool' then return true.
:
: Does anyone have any idea how to do it?
perldoc -f index
perldoc perlre
------------------------------
Date: Wed, 4 Aug 1999 22:36:44 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: patten matching
Message-Id: <Pine.GSO.4.10.9908042235550.27740-100000@crusoe.crusoe.net>
[posted & mailed]
On Aug 5, ming@tickets.com blah blah blah:
> for example: if I compare 'abc' agaist '123abciool' then return true.
Sure. If you're using constant strings (and not real "patterns", or
regular expressions) use the index() function.
perldoc -f index
--
jeff pinyan japhy@pobox.com
perl stuff japhy+perl@pobox.com
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN
------------------------------
Date: Thu, 05 Aug 1999 02:34:56 GMT
From: karl_s_eiringer@my-deja.com
Subject: Re: patten matching
Message-Id: <7oat8g$ekf$1@nnrp1.deja.com>
> for example: if I compare 'abc' agaist '123abciool' then return true.
>
index($a,$b): is -1 if $b is not in $a
if (-1 != index('123abciool','abc') ) {
print "found substring!";
} else {
print "found nothing!";
}
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 4 Aug 1999 19:54:49 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: patten matching
Message-Id: <MPG.12129cd4f65cce7989dd8@nntp.hpl.hp.com>
In article <7oar11$d2r$1@nnrp1.deja.com> on Thu, 05 Aug 1999 01:56:53
GMT, ming@tickets.com <ming@tickets.com> says...
> I need to compare string1 to string2, if string1 is a substring of
> string2, then return truth.
>
> for example: if I compare 'abc' agaist '123abciool' then return true.
>
> Does anyone have any idea how to do it?
Did you try searching perlfunc for the word 'substring' that is in your
problem statement? The very first match will be in the description of
the function that you need.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 05 Aug 1999 03:08:25 GMT
From: smanes@NOSPAM.HEREmagpie.com (Steve Manes)
Subject: Re: patten matching
Message-Id: <37aaff50.218977046@news.panix.com>
On Thu, 05 Aug 1999 01:56:53 GMT, ming@tickets.com wrote:
>I need to compare string1 to string2, if string1 is a substring of
>string2, then return truth.
if ($string2 =~ /$string1/) ...
------------------------------
Date: Thu, 05 Aug 1999 03:56:10 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: PDF file not rendered on Explorer
Message-Id: <uX7q3.260$Qj2.9513@nsw.nnrp.telstra.net>
In article <37A8791F.7A88@hotmail.com>,
Ratna Kumar <kumar_ratna@hotmail.com> writes:
> I have a perl script that renders a PDF file on the browser.
No, you don't.
> I am able to see it alright on Netscape . When I try to
> access the same from explorer , it launches the acrobat 3.0
> but comes up with a blank page. I am using explorer version 4.0.
And how exactly do you imagine that this has anythiong whatsoever to
do with perl? All that perl does is print out a HTTP header:
> print "Location: $file_name\n\n";
And then you use some buggy browsers to get the output of that perl
script. The fact that they don't do what you want them to do doesn;t
surprise me, but it is _not_ an issue with perl.
You should discuss this on a newsgroup that talks about PDF, Adobe
Acrobat Reader, HTML, HTTP, and/or web browsers.
comp.text.pdf
comp.infosystems.www.*
Martien
--
Martien Verbruggen |
Interactive Media Division | That's funny, that plane's dustin'
Commercial Dynamics Pty. Ltd. | crops where there ain't no crops.
NSW, Australia |
------------------------------
Date: Thu, 05 Aug 1999 03:35:31 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl vs HTML
Message-Id: <7E7q3.241$Qj2.9513@nsw.nnrp.telstra.net>
In article <37A8BDC0.EC693C6B@club-internet.fr>,
YANG Tong <ytong@club-internet.fr> writes:
> Just a question: with HTML we can write *crazy* code...
HTML is not code. Not in this newsgroup.
> I must manipulate all this HTML particularities...
HTML::Parser comes to mind.
> So how can I do, if I want someting like :
>
> $ch=" <A HREF=/toto/titi.html ></A> ";
> $ch=~s/(^.*?href\s*=\s*)("|'|)(.*?)(\1|\s|>)(.*$)/$1$2hello.html$4$5/i;
This is really bad. Both the HTML and the RE are not very beautiful.
Make sure you capture what you want, and there's no need to capture
what you don't want. Bust most importantly, you need to make sure that
your backreferences match your capturing parens. And even if you do
that, you'll miss the ones without quotes. Another one that does
almost the same thing, but also forgives eroneous quoting, and will
more or less fix it. It allows many bad html things, which I consider
a bad thing:
s/^(.*?href\s*=\s*)(["']?).*?(\s|>)/$1$2hello.html$2$3/i;
But I wouldn't even want to do this. It's ugly, error-prone, and hard
to debug. It will most likely start to fail when you have more than
one anchor in your string. Again: use HTML::Parser.
Martien
--
Martien Verbruggen |
Interactive Media Division | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: Thu, 05 Aug 1999 03:41:53 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl vs HTML
Message-Id: <5K7q3.246$Qj2.9513@nsw.nnrp.telstra.net>
Please fix your quoting style. The quoted message come _before_ your
own, and is trimmed to show only the relevant stuff.
In article <37A8B09E.D6962EDB@ebay.sun.com>,
Biju Abraham <biju.abraham@ebay.sun.com> writes:
[FIXED QUOTING]
> YANG Tong wrote:
>> So how can I do, if I want someting like :
>>
>> $ch=" <A HREF=/toto/titi.html ></A> ";
>> $ch=~s/(^.*?href\s*=\s*)("|'|)(.*?)(\1|\s|>)(.*$)/$1$2hello.html$4$5/i;
>>
>> In fact I want to recup the link (/toto/titi.html); treat it and replace
>> it ! The problem is the symbol " or ' or nothing ...
> How are you receiving the value to $ch ? If its within perl, then you
> will have
> $ch = " <A HREF=\"/toto/titi.html\" ></A> ";
That is exactly what he wrote. isn't it?
> $ch =~
> s/^(.*?href\s*=\s*)(\"*|\'*)(.*?)("*|'*)(\s*>\s*.*$)/$1$2hello.html$4$5/i;
while (<DATA>)
{
s/(^.*?href\s*=\s*)("|'|)(.*?)(\2|\s|>)(.*$)/$1$2hello.html$4$5/i;
print;
s/^(.*?href\s*=\s*)(\"*|\'*)(.*?)("*|'*)(\s*>\s*.*$)/$1$2hello.html$4$5/i;
print;
print "\n";
}
__DATA__
<a href="/foo/bar/banana" attrib="foobaz">flop</a>
<a href=/foo/bar/banana attrib="foobaz">flop</a>
<a href='/foo/bar/banana' attrib="foobaz">flop</a>
OUTPUT:
<a href="hello.html" attrib="foobaz">flop</a>
<a href="hello.html">flop</a>
<a href=hello.html/foo/bar/banana attrib="foobaz">flop</a>
<a href=hello.html">flop</a>
<a href='hello.html' attrib="foobaz">flop</a>
<a href=hello.html">flop</a>
Now, do you really consider that an improvement? Your regexp breaks
all of the three examples, while the original only breaks one.
Martien
--
Martien Verbruggen |
Interactive Media Division | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd. | things get worse.
NSW, Australia |
------------------------------
Date: Thu, 05 Aug 1999 03:43:50 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl vs HTML
Message-Id: <WL7q3.247$Qj2.9513@nsw.nnrp.telstra.net>
In article <37A8A2D9.234B53D0@kawo2.rwth-aachen.de>,
Alex Farber <alex@kawo2.rwth-aachen.de> writes:
> YANG Tong wrote:
>> The problem is the symbol " or ' or nothing ...
>
> ["']?
is identical in behaviour to ("|'|) which is in the original try, even
though it is more elegant/customary.
Martien
--
Martien Verbruggen |
Interactive Media Division | +++ Out of Cheese Error +++ Reinstall
Commercial Dynamics Pty. Ltd. | Universe and Reboot +++
NSW, Australia |
------------------------------
Date: Thu, 05 Aug 1999 11:39:30 +0800
From: Sunny Yeung <sunyueng@scmp.com>
Subject: read, write and sysread, syswrite?
Message-Id: <37A90772.986EC3B0@scmp.com>
Hello,
I don't understand what is the different
between read & sysread, write & syswrite.
If they do have difference, when,why and where
to use them.
------------------------------
Date: Thu, 05 Aug 1999 03:59:42 GMT
From: smanes@NOSPAM.HEREmagpie.com (Steve Manes)
Subject: Re: read, write and sysread, syswrite?
Message-Id: <37af0a20.221745720@news.panix.com>
On Thu, 05 Aug 1999 11:39:30 +0800, Sunny Yeung <sunyueng@scmp.com>
wrote:
> I don't understand what is the different
> between read & sysread, write & syswrite.
> If they do have difference, when,why and where
> to use them.
On Unix boxes, 'read' is implemented with 'fread', which employs the
higher level stdio layer. 'sysread' uses the 'read' system call which
is bound closer to the operating system. Same diff with 'syswrite'.
The main reason to use 'sysread' or 'syswrite' is for lower-level
programming where buffering or software interrupts might be
problematic.
------------------------------
Date: Wed, 4 Aug 1999 19:50:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: regexp - subtitute everything than
Message-Id: <MPG.12129be6893d565c989dd7@nntp.hpl.hp.com>
In article <F06q3.1545$001.740681@WReNphoon3> on Wed, 04 Aug 1999
17:43:11 -0800, Karl Seiringer <karl@t0.or.at> says...
Now that is FOUR postings of the same (I guess) thing. Are you loco?
Oops, sorry, make that verrückt?
> -**** Posted from RemarQ, http://www.remarq.com/?c ****-
> Search and Read Usenet Discussions in your Browser
Whatever it is, that is no excuse.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 04 Aug 1999 22:10:13 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: regexp can be your friend
Message-Id: <x71zdjhta2.fsf@home.sysarch.com>
>>>>> "e" == elephant <elephant@squirrelgroup.com> writes:
e> Uri Guttman writes ..
>> i tried a lookahead version but it doesn't seem to work:
>>
>> perl -pe 's/(ab)(?=\1)/xx/'
>>
>> maybe ilya could exlain why? and i am sure he has new tricks which can
>> do this too.
e> works for me .. sure you're not expecting it to do this
e> s/(ab)(?=.*\1)/xx/
i think that is what i wanted. somehow i lost track of the fact that i
needed a .*. but my other solution worked too.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: 04 Aug 1999 22:07:19 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Repetition in RE substitutions
Message-Id: <x74sifhtew.fsf@home.sysarch.com>
>>>>> "A" == Abigail <abigail@delanet.com> writes:
A> Uri Guttman (uri@sysarch.com) wrote on MMCLXIV September MCMXCIII in
A> <URL:news:x73dxzk1i1.fsf@home.sysarch.com>:
A> <> s/(?<=\([:\d]+):(?=[:\d]+\))/%/g ;
A> It's great that it worked for you, but according to the manual, it's
A> not supposed to!
A> From 'man perlre':
A> (?<=pattern)
A> A zero-width positive lookbehind assertion. For
A> example, /(?<=\t)\w+/ matches a word following a
A> tab, without including the tab in $&. Works
A> only for fixed-width lookbehind.
A> With the + there, it isn't fixed width. Either you're lucky, or the
A> manual is wrong.
now that you remind me, i ran into that problem, but the solution only
needed the forward lookahead. as this was for someone else, i keep
forgetting what i gave him.
oh, well my own example keeps being shredded but i solved the original
poster's problem. and my essay had some merit in explaining how look
ahead/behind should be called assertions.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Thu, 05 Aug 1999 02:09:06 GMT
From: Dheera <dheera@my-deja.com>
Subject: Search algorithm in Perl
Message-Id: <7oarns$dng$1@nnrp1.deja.com>
Hi,
I'm trying to build a search-engine (in Perl) which can search about
1 million database records in less than 1 second (if possible) on my hz
Pentium II.
I can afford to use upto 8 GB for this size of database - and I have
64 MB of RAM available.
Could someone help me with what algorithms I could program, or what
freeware search engines are available to meet these?
I am pretty sure it can be done - even if it takes a lot of disk space
it is okay.
I have tried using a gigantic hash table with truncation for key
selection, but it is quite slow... and so is ODBC.
Please help...
Thanks in advance.
Dheera
dheera@usa.net
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 4 Aug 1999 20:56:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: unus sed leo
Message-Id: <MPG.1212ab55a0ab6d3d989dd9@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <37a8e8dc@cs.colorado.edu> on 4 Aug 1999 19:29:00 -0700, Tom
Christiansen <tchrist@mox.perl.com> says...
...
> A quote I just read springs to mind for this situation. It's from Aesop,
> and is what the lioness replied to the vixen who had been boasting about
> how she had so many offspring, but the lioness only had one.
>
> "Unus sed leo", says the lioness, meaning "One, but [it is] a lion."
How very clever of the animals in Aesop the Greek's fables to speak
Latin!
> Innumerable stories are recounted of tiger teams of programming gods
> who, in a few days of Herculean labor, recreate in blinding clarity
> and dramatic improvemnt the work of scores of drones who'd strugled
> over something for months and months. Rumor has it that at the Labs
> someone once decided that the optimal way to get nearly any software
> project done in the least time, the least cost, and the highest quality
> (all by several orders of magnitude) was to lock away Ken and a couple
> of his pals into a hacking room for a long weekend of work.
Indeed. And then if anything useful (like Unix or C, for example)
emerged, they threw it over the wall to my lab, where scores of non-
lions (drones, I see you call them) did source control, documentation,
unit test, integration, system test, and release. There would have been
no 'products' without teams like that. (But 'computer science' might
have progressed anyhow.)
Of course, nowadays they could throw it over the wall as Open Source,
and scores of drones might do the same things without pay. How the
world has progressed, to where software development is volunteerism.
(ObPerl: vide Perl!)
> The connections between the lions, tigers, and Ken Thompson, and the
> meaning of this our story, these things I leave up to you my humble
> readers--should there be any of you about. :-)
I am at least one reader, but not very humble, IMNSHO. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 05 Aug 1999 03:48:59 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: while loop teminates too early
Message-Id: <LQ7q3.252$Qj2.9513@nsw.nnrp.telstra.net>
In article <37A8AAF0.93A8568E@uiuc.edu>,
Andy Collado <acollado@uiuc.edu> writes:
> Evidently, the while loop does not like the else statement inside it. Once
> I took that out, it worked fine. All i had to do was invoke the sub &goaway
> outside the while loop and all went well.
Nonsense. while loops do not care at all about if-else constructions
in the block. if they did, Perl would be severely broken. I am
absolutely certain that you did more than just remove the else
statement. As has been pointed out to you, that exit is much more
likely to be the problem.
Don't lie to us.
Martien
--
Martien Verbruggen |
Interactive Media Division | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd. | password?
NSW, Australia |
------------------------------
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 376
*************************************