[13313] in Perl-Users-Digest
Perl-Users Digest, Issue: 723 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 6 16:23:18 1999
Date: Mon, 6 Sep 1999 13: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 Mon, 6 Sep 1999 Volume: 9 Number: 723
Today's topics:
Re: ANN: variable interpolation within strings help pag <garethr@cre.canon.co.uk>
Re: CGI.pm on linux <paulreid@cableinet.co.uk>
Re: Find MAC address (Richard Warkentin)
Re: Form2Mail without user interaction? <mike@crusaders.no>
Hopefully on-topic CGI question: simple db routine work (Christopher R. Barry)
How can i unlink some files?? <abel.almazan@ogilvyinteractive.es>
Re: How can i unlink some files?? ()
Re: How to make a dynamically updating Tk page? <llornkcor@llornkcor.com>
Re: How to Process MULTIPLE select values ()
Re: mysql interview <gellyfish@gellyfish.com>
Re: mysql interview (Gabor)
Re: mysql interview <marcel.grunauer@lovely.net>
Re: mysql interview <marcel.grunauer@lovely.net>
Re: newbie suffering with modules <gellyfish@gellyfish.com>
Re: Newbie: Perl DOS Window Runs Too Fast <llornkcor@earthlink.net>
non oop style <jimmy@blackhole-designs.com>
Re: Perl on VMS? <anders_wallin@my-deja.com>
Re: Randal vandal aborts Schwartz (Randal L. Schwartz)
Re: Regular Expressions (Richard L. Anderson)
Re: Routine for normalising file paths (Larry Rosler)
Re: un-importing names <garethr@cre.canon.co.uk>
Re: using code written in C (anyone know about stemming <theglauber@my-deja.com>
Win95 Perl interpretor <eri-joer@online.no>
Re: Win95 Perl interpretor <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 6 Sep 1999 16:16:35 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: elephant@squirrelgroup.com (elephant)
Subject: Re: ANN: variable interpolation within strings help page
Message-Id: <si906knhgc.fsf@cre.canon.co.uk>
elephant <elephant@squirrelgroup.com> wrote:
> stemming from a recent thread in this newsgroup I have put together a
> few observations on how Perl 5.005_03 does interpolation within strings
>
> http://www.squirrelgroup.com/perl/interpolation.html
You should probably include a reference to the section "Gory details of
parsing quoted constructs" in recent versions of the perlop manpage.
(See also http://www.deja.com/getdoc.xp?AN=509440440&fmt=text.)
--
Gareth Rees
------------------------------
Date: Mon, 06 Sep 1999 17:29:38 +0100
From: Paul Reid <paulreid@cableinet.co.uk>
Subject: Re: CGI.pm on linux
Message-Id: <37D3EBF2.AF0A3D0F@cableinet.co.uk>
I see
I had just copied the cgi.pm file from the C:\Perl\bin dir on my computer and
uploaded it to my cgi-bin dir on my serverjust as I did with cgi-lib.pl.
But it doesnt work like that ?Is it sort of integrated within perl?
I am right to assume that I should not need to upload anything to my server to
begin using cgi.pm if my server is currently running the correct version of
perl?And whether or not I copied a version of cgi.pm to my cgi-bin dir would make
no difference because perl doesnt even look for it there
thanks
------------------------------
Date: Mon, 06 Sep 1999 17:51:59 GMT
From: "rdw2 at mindspring dot com"@test.com (Richard Warkentin)
Subject: Re: Find MAC address
Message-Id: <37d3fdbd.3165932@news.mindspring.com>
On Mon, 06 Sep 1999 14:59:31 GMT, "Wylie Gerdes"
<wgerdes@oeonline.com> wrote:
>I'd like to retrieve MAC address from network clients for a wake-on-lan
>effort. I see no hints in the documentation; any ideas or leads?
>
>
You didn't mention the OS you are using.
For Win NT, the answer is parse ipconfig /all.
For W95, there are undocumented switches (after somone told me, I was
able to find on web) to winipcfg. From memory, the options are /batch
/all. There is also a way to specify where the output goes but, by
default, it goes into c:\--again, from memory.
------------------------------
Date: Mon, 6 Sep 1999 19:56:02 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Form2Mail without user interaction?
Message-Id: <9fTA3.451$je3.3674@news1.online.no>
Trond Michelsen <mike@crusaders.no> wrote in message
news:1qMz3.100$XR4.666@news1.online.no...
> TomTech <NoOne@Home.Here> wrote in message
> news:37cf6668.9111390@news.gte.net...
> > Is there a way of using the form2mail system and
> > have an email sent triggered by the loading of the
> > page by the user alone?
>
> Yes, but it won't work on every browser.
>
> > I don't want the user to have to interact at all.
> > I want an email sent to me each time the page is
> > accessed, automatically.
>
> Then you need to fill out the form with hidden-fields and subit it
with
> javascript when the page is loaded.
>
> This requires knowledge in HTML and Javascript. Unfortunately, this
> newsgroup is for discussing Perl.
Let me correct myself.
During the weekend I finally had a chance to read the mod_perl book
("Writing Apache modules in Perl and C"), and in this book there is an
example of how you can use mod_perl to intercept Apache's logging
process and even send a mail every time a spesific (or all for that
matter) URL has been hit. This solution does require an Apache
installation with mod_perl of course, but it is pure Perl and it will
work on any browsers (it will even work when somebody telnets to the
server and executes a HTTP-request on their own), so the question wasn't
as off-topic as I first thought.
--
Trond Michelsen
I've gotta start fiddling with mod_perl soon...
------------------------------
Date: Mon, 06 Sep 1999 19:44:44 GMT
From: cbarry@2xtreme.net (Christopher R. Barry)
Subject: Hopefully on-topic CGI question: simple db routine works stand-alone but not as CGI.
Message-Id: <87ogff3jdc.fsf@2xtreme.net>
I have a _very_ simple Perl script that when run stand-alone stores a
simple hash table that maps names to phone-numbers as a dbm file but
when run as a CGI results in the following error:
[Mon Sep 6 12:20:42 1999] [error] [client 192.168.0.1] Premature end
of script headers: /home/cbarry/public_html/cgi-bin/phone-number-database.cgi
ndbm store returned -1, errno 13, key "some-guy" at
/home/cbarry/public_html/cgi-bin/phone-number-database.cgi line 14.
Here is the script. I uncomment the "chomp" lines and comment the
"param" lines for standalone mode which works fine. Other simple CGIs
work fine for me -- including this one if I comment out the dbm code
(so that the success message is printed without the wanted side-effect
of being stored in the db). The fact that the db code works fine
stand-alone but not as a CGI is extremely frustrating and driving me
insane.
---------------------------
#!/usr/bin/perl -w
use CGI qw(param);
$name = param("name");
$phone_number = param("phone-number");
# chomp ($name = <STDIN>);
# chomp ($phone_number = <STDIN>);
dbmopen (%phone_numbers, "phone-numbers", 0666) ||
die "can't dbmopen phone-numbers: $!";
$phone_numbers{$name} = $phone_number;
dbmclose (%phone_numbers) || die "can't close phone-numbers: $!";
print <<PRINT_END;
Content-type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>Phone numbers database</title>
</head>
<body>
<p>Name $name with phone-number $phone_number submitted.</p>
</body>
</html>
PRINT_END
----------------------------------
Christopher
------------------------------
Date: Mon, 06 Sep 1999 17:38:44 +0200
From: Abel =?iso-8859-1?Q?Almaz=E1n?= <abel.almazan@ogilvyinteractive.es>
Subject: How can i unlink some files??
Message-Id: <37D3E003.1842B492@ogilvyinteractive.es>
If i want to unlink all files in a subdirectory, what can i do??
i tried with:
unlink (/dir/*.*);
and
unlink (/dir/*);
but it doesn't works.
Thanks
------------------------------
Date: Mon, 06 Sep 1999 17:02:20 GMT
From: mike@stok.co.uk ()
Subject: Re: How can i unlink some files??
Message-Id: <wsSA3.641$U5.594203@typhoon1.austin.rr.com>
In article <37D3E003.1842B492@ogilvyinteractive.es>,
Abel Almazán <abel.almazan@ogilvyinteractive.es> wrote:
>If i want to unlink all files in a subdirectory, what can i do??
>
>i tried with:
>
> unlink (/dir/*.*);
>and
> unlink (/dir/*);
>
>but it doesn't works.
unlink doesn't do "globbing", the expansion of wildcards.
One thing to do might be to use perl's glob to generate a list of
directory entries which match your specification and then feed that list
to unlink e.g.
@list = glob('/dir/*');
if (@list) {
$count = unlink @list;
...
}
or use the command
perldoc -t -f unlink
to see the documentation for unlink which has an example you might modify.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
| 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 06 Sep 1999 13:27:08 -0600
From: ljp <llornkcor@llornkcor.com>
Subject: Re: How to make a dynamically updating Tk page?
Message-Id: <wkn1uzc037.fsf@llornkcor.com>
how about using
<meta http-equiv="refresh" content="0; url=whateverThisPageIsCalled.html">
------------------------------
Date: Mon, 06 Sep 1999 15:51:25 GMT
From: mike@stok.co.uk ()
Subject: Re: How to Process MULTIPLE select values
Message-Id: <1qRA3.1247$kR2.764873@typhoon2.austin.rr.com>
In article <37d2d404_2@newsread3.dircon.co.uk>,
Andrew Whitaker <bigsleep@dircon.co.uk> wrote:
>
>WebMan wrote in message ...
>>I have a form that has a <SELECT MULTIPLE NAME="FOO"> defined in it and I
>>want to process the multiples. My program ends up placing only the last
>>selected option value in the hash no matter what.
>
>Try
>$Hash{$Key} .= "," if defined $Hash{$Key};
>$Hash{$Key} .= "$Value";
>
>look at the input stream, it contains multiple lines of the same key.
If you're going to have the possibility of having multiple values for any of
the hash keys then you might consider them all to be lists of one or more
keys and say
push @{$Hash{$Key}}, $Value;
which saves all of the joining & splitting problems.
As another poster has said, CGI.pm does it for you for CGI programming, but
this sort of thing crops up in many other places.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
| 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
| 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 6 Sep 1999 16:57:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: mysql interview
Message-Id: <37d3e472_2@newsread3.dircon.co.uk>
George Reese <borg@imaginary.com> wrote:
> Abigail <abigail@delanet.com> wrote:
> : Makarand Kulkarni (makkulka@cisco.com) wrote on MMCLXXXV September
> : MCMXCIII in <URL:news:37C36944.2BB77495@cisco.com>:
> : __ [ barrytownbb@yahoo.com wrote:
> : __
> : __ > I wanted to get a headstart on essential reading for being "tech-ed out"
> : __
> : __ A new book is now out --
> : __ MySQL and mSQL (Nutshell Series)
> : __ by Randy Jay Yarger, George Reese, Tim King
>
>
> : *ahum* Better not get me as the interviewer then.
>
> : Me: Did you learn anything from George Reese?
> : Candidate: *nod* *nod*
> : Me: You will be hearing from us. Goodbye.
>
> Jesus, Abigail, did I shoot your dog or something?
>
> You have no basis of making such a claim, and it is a completely
> absurd statement. The book is a good book.
>
I would say your ridiculous two week campaign of trolling this time
last year would be sufficient basis:
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Date: 10 Sep 1998 00:00:00 GMT
Message-ID: <MpFJ1.544$E9.1882388@ptah.visi.com>
Perl has no real use. If you have to do scripting or text processing,
use Python. Otherwise, use Java.
/J\
--
"If they want a circus, they have come to the right person" - Neil
Hamilton
------------------------------
Date: 6 Sep 1999 12:01:06 -0400
From: gabor@vmunix.com (Gabor)
Subject: Re: mysql interview
Message-Id: <slrn7t7pa2.qqh.gabor@vnode.vmunix.com>
In comp.lang.perl.misc, George Reese <borg@imaginary.com> wrote :
# Abigail <abigail@delanet.com> wrote:
# : George Reese (borg@imaginary.com) wrote on MMCXCVII September MCMXCIII in
# : ~~ You have no basis of making such a claim, and it is a completely
# : ~~ absurd statement. The book is a good book.
#
# : It has your name on it. How can it be?
I don't know. Uri and her certainly convinced me not to buy that
book. Especially based on your posting here in the past. ;)
# You have no idea who I am and no meaningful experience with anything I
# have done. So how can you possibly make such an observation?
#
# You can't. You just have personal issues you are incapable of dealing
# with and wish to poison the world with them.
#
# --
# George Reese (borg@imaginary.com)
# http://www.imaginary.com/~borg
# "The dead know only one thing: it's better to be alive"
# -Joker in Full Metal Jacket
------------------------------
Date: Mon, 06 Sep 1999 16:46:15 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: mysql interview
Message-Id: <gv3TNzCizdL1t5=rooBVStmD43AI@4ax.com>
On Mon, 06 Sep 1999 15:00:45 GMT, George Reese <borg@imaginary.com>
wrote:
> Abigail <abigail@delanet.com> wrote:
> : George Reese (borg@imaginary.com) wrote on MMCXCVII September MCMXCIII in
> : ~~ You have no basis of making such a claim, and it is a completely
> : ~~ absurd statement. The book is a good book.
>
> : It has your name on it. How can it be?
>
> You have no idea who I am and no meaningful experience with anything I
> have done. So how can you possibly make such an observation?
>
> You can't. You just have personal issues you are incapable of dealing
> with and wish to poison the world with them.
Well, in light of previous "meaningful experiences" with your
handiwork, I hope you didn't write your book with Perl in mind, but,
say Python, or Java.
In this case I bid you good riddance.
Marcel
Perl Padawan
--
sub AUTOLOAD{($_=$AUTOLOAD)=~s,^.*::,,;y,_, ,;print} Just_Another_Perl_Hacker();
------------------------------
Date: Mon, 06 Sep 1999 18:46:01 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: mysql interview
Message-Id: <IRnUN+dbobc7HjX8X7bm4toL7SF0@4ax.com>
On Mon, 06 Sep 1999 15:00:45 GMT, George Reese <borg@imaginary.com>
wrote:
> Abigail <abigail@delanet.com> wrote:
> : George Reese (borg@imaginary.com) wrote on MMCXCVII September MCMXCIII in
> : ~~ You have no basis of making such a claim, and it is a completely
> : ~~ absurd statement. The book is a good book.
>
> : It has your name on it. How can it be?
>
> You have no idea who I am and no meaningful experience with anything I
> have done. So how can you possibly make such an observation?
>
> You can't. You just have personal issues you are incapable of dealing
> with and wish to poison the world with them.
Actually, after re-reading all of your postings of last year regarding
this issue, I found remarks like "Look, dumbass", "idiot", "you are a
fucking idiot", "bullshit" etc.
These remarks should also be posted as an aside to a review of your
books to Amazon et al, maybe, just to let potential buyers ascertain
your mental stability before parting with their money.
I've decided you suck.
*plonk*
Marcel
Perl Padawan
--
sub AUTOLOAD{($_=$AUTOLOAD)=~s,^.*::,,;y,_, ,;print} Just_Another_Perl_Hacker();
------------------------------
Date: 6 Sep 1999 16:43:20 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: newbie suffering with modules
Message-Id: <37d3e118_2@newsread3.dircon.co.uk>
mikedel@ix.netcom.com wrote:
>
> One is called Learning Perl, which you can get more info here:
> <a
> href="http://www.amazon.com/exec/obidos/ASIN/1565922840/productlink>Lear
> ning Perl</a>
>
It is considered to be in very, very bad taste to post these associate links.
/J\
--
"Childbirth is god's way of telling you that heterosexuality isn't
natural. It's got to be easier to get a penis up your arse than a baby
out of your vagina" - Graham Norton
------------------------------
Date: Mon, 06 Sep 1999 09:50:00 -0600
From: llornkcor <llornkcor@earthlink.net>
Subject: Re: Newbie: Perl DOS Window Runs Too Fast
Message-Id: <37D3E2A8.5D99F17D@earthlink.net>
David Efflandt wrote:
>
> On Sun, 05 Sep 1999 12:00:17 +0000, David <hansi@lancnews.infi.net> wrote:
> >I just bought a "Perl 5 How To" book with a CD-ROM. It says I have to
> >have access to a server with Perl on it, but I want to run it on my
> >Windows 98 machine first. The problem I'm running into is that there is
> >a version of Perl32.exe on my PC on which I am running the book's
> >scripts, BUT the trouble is that a MS-DOS window opens up to run the
> >script and then closes so quickly that I can't see what the script
> >does. When I eventually tailor one of these scripts or write my own, I
> >want to test it on my PC before uploading it to the cgi-bin on the
> >server.
> >
> >
> But if your web host uses the apache webserver, it is much easier in the
> long run to install Linux on your PC with apache, so you can test
> everything exactly like it will run on the web.
or you could install Apache in windows.
------------------------------
Date: Mon, 06 Sep 1999 17:28:54 GMT
From: Jimmy Humphrey <jimmy@blackhole-designs.com>
Subject: non oop style
Message-Id: <37D3F9CC.693B9A36@blackhole-designs.com>
I was wondering where I could learn to convert code that uses oop (like
below in a CGI.pm example) to function based code, and maybe the other
way around. Use the code below if you want to help explain how I could
do it.
Jimmy
$query = new CGI;
$filename = $query->param('uploaded_file');
$type = $query->uploadInfo($filename)->{'Content-Type'};
unless ($type eq 'text/html') {
die "HTML FILES ONLY!";
}
------------------------------
Date: Mon, 06 Sep 1999 15:04:35 GMT
From: Anders Wallin <anders_wallin@my-deja.com>
Subject: Re: Perl on VMS?
Message-Id: <7r0l5r$p94$1@nnrp1.deja.com>
In article <37C1997D.E9177971@email.sps.mot.com>,
Mike.G.Garcia@motorola.com wrote:
> Hello,
>
> Does anyone have any experience with Perl running on VMS?
>
> I'd like to know if there are any major difference from Perl that runs
> on Unix.
> We are running Perl 5.004, is it available for VMS?
> If we develop a script on the VMS version, would it be portable
> to the Unix version?
>
> Thank you for your comments.
> Mike
>
I have just downloaded the most recent sources 5.005.03
and built it on VMS. There were no problems doing that.
We are just at the start of an evaluation process where
we are looking for a replacement to the now obsolete
compiler VAXScan, which in a way resembles some of the
functionality found in Perl.
Thats all I can contribute with at the moment.
Anders wallin
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 06 Sep 1999 10:56:44 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Randal vandal aborts Schwartz
Message-Id: <m13dwrgbz7.fsf@halfdome.holdit.com>
>>>>> "Neale" == Neale Morison <nmorison@ozemail.com.au> writes:
Neale> Mr Schwartz was kind enough to point me to his web site for help with
Neale> examples of the LWP module. There I found a piece of code that appeared to
Neale> be the answer to my admittedly nerdy prayers:
Neale> http://www.stonehenge.com/merlyn/WebTechniques/col14.html
You should be using col35, not col14. :) I keep updating my knowledge
of how to do link verifiers, and it just keeps getting better.
Neale> Imagine my dismay when I received the message:
Neale> Can't locate object method "authority" via package "URI::mailto" at
Neale> /perl/site/lib/URI/WithBase.pm line 41.
In later versions of my link checkers (like the one at col35), I've
added the mysterious:
sub URI::mailto::authority { ""; } # workaround bug
I've sent this bug to Gisle Aas, who has told me that he doesn't
understand why I need the workaround. All I know is that when I
define this subroutine, I don't get the errors that you report. :) I
don't think he expected anyone to invoke:
my $url = URI->new_abs("http://machine.com/foo/bar", "mailto:him\@x.org");
though.
Neale> Another odd problem I found was that when I used this code over
Neale> the LAN at work, the content_type was often returned empty, so
Neale> the code didn't parse the files. Over a modem connection at
Neale> home content_type read correctly.
That's odd. Perhaps the servers were getting overloaded by having so
many hits quickly in a row? Dunno. Those early versions might have
needed a sleep 1 or something between fetches. Would have been nicer.
Neale> I'm using ActiveState Perl on a Windows machine.
Neale> I'd appreciate any comments on this. Regards, Neale
Comments on the fact that you use a Windows machine? Don't
get me started. :) :) :)
--
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: Mon, 06 Sep 1999 10:39:31 -0500
From: anderson@unt.edu (Richard L. Anderson)
Subject: Re: Regular Expressions
Message-Id: <anderson-0609991039310001@skky.scs.unt.edu>
In article <37D3D3E8.E725FC2C@gmx.de>, m.scheferhoff@gmx.de wrote:
> Hello,
>
> ich have a problem with regular expressions. I have this string or
> something like this:
>
> <caddaar<test<hello
>
> If want to cut everything including the second "<".
>
> Does anybody know the expression for this?
>
> Thanks,
>
> Michael
Checkout perldoc perlre or the section on patern matching in the camel
starting on page 58.
#!perl -w
use strict;
my $testString = "<caddaar<test<hello";
if ($testString =~ /<.*?<(.*)/){
print $1;
}
------------------------------
Date: Mon, 6 Sep 1999 09:02:21 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Routine for normalising file paths
Message-Id: <MPG.123d855c6b08ae2b989f1b@nntp.hpl.hp.com>
In article <uaer0rgzp.fsf@infoscience.otago.ac.nz> on 06 Sep 1999
13:00:42 +1200, Andrew Gray <agray@infoscience.otago.ac.nz> says...
> Neale Morison <nmorison@ozemail.com.au> writes:
> > I have in my confused way been attempting to write a subroutine meant to
> > take a path such as ../mary/alice/george/../fred/../../ralph/ted and
> > convert it to ../mary/ralph/ted
>
> So you want to recursively remove any occurences of m!/\w*/\.\.!.
That's what the example looks like, but filenames are by no means
restricted to '\w' characters. As someone pointed out yesterday, on
many systems the only invalid characters are '/' and "\0". So you
should work on that assumption.
Also, your regex would remove a pair of directories such as 'x/..y/',
which is not wanted.
What is wanted is to repeatedly remove any occurrences of m![^/]+/\.\./!
So the key statement is (as you have suggested):
1 while s![^/]+/\.\./!!;
One might make that slightly more complicated to accept a trailing '..':
1 while s![^/]+/\.\.(?:/^$)!!;
And faster by allowing several of these reductions to go on in parallel:
1 while s![^/]+/\.\.(?:/^$)!!g;
But the general idea is right.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 6 Sep 1999 16:08:19 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: moseley@best.com (Bill Moseley)
Subject: Re: un-importing names
Message-Id: <sid7vwnhu4.fsf@cre.canon.co.uk>
Bill Moseley <moseley@best.com> wrote:
> use CGI qw/:standard :html3/; # import symbols
>
> I forgot how to say "but, don't import symbol 'sub'". Where is it in
> the docs?
Look at the manpage for the Exporter module.
--
Gareth Rees
------------------------------
Date: Mon, 06 Sep 1999 17:38:41 GMT
From: The Glauber <theglauber@my-deja.com>
Subject: Re: using code written in C (anyone know about stemming?)
Message-Id: <7r0u6v$vjg$1@nnrp1.deja.com>
In article <MPG.123d7071c29264b4989708@nntp1.ba.best.com>,
moseley@best.com (Bill Moseley) wrote:
> I'm using Text::English to try to match stemmed words used in a search
> engine. Just my luck that they don't stem the same.
>
> Text::English Indexer -> Indexer
> stem.c Indexer -> Index
>
> Hard to know (for me) which is right.
Maybe both right, just different? :-)
If you need to get the exact same results, i think you should use the same
(C) code.
Adding C code to Perl is NOT that hard. Look into the documentation for
"perlxstut", "perlxs", "ExtUtils::MakeMaker" and "perlguts", in this
sequence. If you are lucky, "perlxstut" is all you need to know. It might
take you 1 day to get your first extension done right, not much more. Chances
are you won't need to relink Perl. You will be using utilities provided with
Perl to create a "dll" and the Perl code that loads it into the standard
Perl. This approach is called "XS".
I'm not sure you mention what OS you are using. I've done this in Unix, but i
believe it works for Windows also.
If you are in Unix, another approach is to use a system called Swig
(http://www.swig.org). Get the "development" version, not the "released" one.
Swig has the advantage of supporting other languages besides Perl.
Which approach you take is mostly personal preference. I've done stuff with
XS and i'm satisfied with it. It's not that hard to create something that
looks really professional, just like all those extensions you can download
from CPAN.
Good luck,
glauber
--
Glauber Ribeiro
theglauber@my-deja.com
"Opinions stated are my own and not representative of Experian"
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 6 Sep 1999 18:04:13 +0200
From: "Erik Jørgensen" <eri-joer@online.no>
Subject: Win95 Perl interpretor
Message-Id: <fBRA3.379$je3.2282@news1.online.no>
Where can I find the Win95 Perl interpretor?
Greetings
Erik Jørgensen
eri-joer@online.no
------------------------------
Date: 6 Sep 1999 17:10:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Win95 Perl interpretor
Message-Id: <37d3e783_2@newsread3.dircon.co.uk>
Erik Jørgensen <eri-joer@online.no> wrote:
> Where can I find the Win95 Perl interpretor?
>
<http://www.activestate.com>
/J\
--
"Malcolm, what have I told you about putting chocolate near your
crotch?" - Mrs Merton
------------------------------
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 723
*************************************