[16468] in Perl-Users-Digest
Perl-Users Digest, Issue: 3880 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 2 06:10:33 2000
Date: Wed, 2 Aug 2000 03:10:22 -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: <965211022-v9-i3880@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 2 Aug 2000 Volume: 9 Number: 3880
Today's topics:
Re: Help with LWP <gellyfish@gellyfish.com>
Re: Help!! <elephant@squirrelgroup.com>
Re: How to install openssl-0.9.3a <jbroz@transarc.com>
labview cgi question <ali@javcorp.com>
Re: labview cgi question (Abigail)
Newbie needs memory <aler@etb.bel.alcatel.be>
Re: On upgrading Perl... <gellyfish@gellyfish.com>
Re: On upgrading Perl... <bart.lateur@skynet.be>
Re: password protected web pages <elephant@squirrelgroup.com>
Re: password protected web pages <gellyfish@gellyfish.com>
Re: Perl - w (PROBLEM) BUG????? <gellyfish@gellyfish.com>
Re: Perl CGI - files occasionally truncated (Logan Shaw)
Perl for automating (web) isp backend <kevin@dnc-electronics.co.uk>
Re: Perl Web Security <gellyfish@gellyfish.com>
Re: perldoc error <gellyfish@gellyfish.com>
Re: posting in newsgroup using perl script? <gellyfish@gellyfish.com>
Re: posting in newsgroup using perl script? <gellyfish@gellyfish.com>
Problems with require <waters@gfms.bt.co.uk>
Problems with require <waters@gfms.bt.co.uk>
Re: question about a Regular Expression <phil.taylor@bigfoot.com>
Re: question about a Regular Expression (Bernard El-Hagin)
Re: question about the insert sql command. <elephant@squirrelgroup.com>
Re: question about tr <bart.lateur@skynet.be>
Re: relative to absolute Hyperlink-URL <gellyfish@gellyfish.com>
Re: relative to absolute Hyperlink-URL <wyzelli@yahoo.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 2 Aug 2000 09:34:16 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help with LWP
Message-Id: <8m8me8$3aj$1@orpheus.gellyfish.com>
On Tue, 01 Aug 2000 05:45:23 -0700 Jeffrey wrote:
> Hi:
> I am trying to use the LWP:UserAgent module and I am having the following
> problem.
>
> I am getting a code 500 back from any url that I try, but this script will
> run correctly from my desktop computer.
>
> When I try to get message (ok,server error,etc) I get an execution error
> from the "message" object
>
> "Can't locate auto/URI/URL/http/path_query.al in @INC............."
>
> Problem is I can't find path_query.al anywhere.
>
> My first question is. Why am I getting the code 500 in the first place?
> Secondly, what is the path_query.al and if I need it where can I get it.
>
I havent got a path_query.al anywhere either but your code runs fine
for me. LWP::UserAgent will return a '500' status when some internal
failure occurs as well as when this is the response from some server.
I think that this is probably caused by the mis-installation of the
module URI::URL or indeed LWP::UserAgent. I would reinstall the modules
and see what happens.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Wed, 02 Aug 2000 07:42:52 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Help!!
Message-Id: <MPG.13f26e5d468e83a19896a5@news>
aunkhin@my-deja.com writes ..
>Wat does the following sentence do?
> $week=shift;
your question has been answered - a long time ago
perldoc -f shift
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Wed, 02 Aug 2000 10:35:36 +0100
From: "Joe_Broz@transarc.com" <jbroz@transarc.com>
Subject: Re: How to install openssl-0.9.3a
Message-Id: <3987EB68.4439F10A@transarc.com>
Jeffrey wrote:
>
> Hi,
>
> I am trying to install openssl-0.9.3a and then Net::SSLeay. I am attempting
> the install on Redhat 6.0.
>
try comp.lang.perl.modules
------------------------------
Date: Wed, 02 Aug 2000 05:50:09 GMT
From: Ali Javey <ali@javcorp.com>
Subject: labview cgi question
Message-Id: <3987B588.68E67C2D@javcorp.com>
I'm having problems with setting up a cgi program in labview that would
allow Internet users to upload a file by using a html form. I have set
up a HTML form, so one can enter the location of a file in his computer
and then submit it. However, the only thing that seems to be sent to
the action vi is the location of the file and not the file itself. I
will be very appreciated if someone can help me with this problem.
Regards,
Ali Javey
------------------------------
Date: 02 Aug 2000 07:39:23 GMT
From: abigail@foad.org (Abigail)
Subject: Re: labview cgi question
Message-Id: <slrn8ofk0t.vcg.abigail@alexandra.foad.org>
Ali Javey (ali@javcorp.com) wrote on MMDXXVIII September MCMXCIII in
<URL:news:3987B588.68E67C2D@javcorp.com>:
|| I'm having problems with setting up a cgi program in labview that would
|| allow Internet users to upload a file by using a html form. I have set
|| up a HTML form, so one can enter the location of a file in his computer
|| and then submit it. However, the only thing that seems to be sent to
|| the action vi is the location of the file and not the file itself. I
Wow, a CGI program written in vi! That's so cool!
|| will be very appreciated if someone can help me with this problem.
Well, it looks that you either have a problem with the wowser, or
with the HTML. Topics concerning web wowsers and HTML aren't discussed
here. Here we discuss the sex life of daffodils. (This weeks hot topic
is interracial relations between daffodils and tulips).
Questions about vi are to be asked in comp.editors.
Abigail
--
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
------------------------------
Date: Wed, 02 Aug 2000 08:45:35 +0200
From: Anthony Leroy <aler@etb.bel.alcatel.be>
Subject: Newbie needs memory
Message-Id: <3987C38E.370FC2DB@etb.bel.alcatel.be>
It seems that even a really small one line program as sleep(10); for
instance takes about 1.8 MB in memory. Why does the perl interpreter
take so much memory?
I've made a program that looks a little bit like this one:
while (my $line = <MYFILE>)
{
($first,$second,$third) = ($line=~/(\d+) (\d+) (\d+)/);
@small_array = ($first,$second,$third);
push (@main_aray,[@small_array]);
}
This program takes a lot of memory (about 10 MB for a 10000 lines input
file) but I only push arrays containing 3 integers... What's going on?
Does Perl allocate a large amount of memory for any array even if it
contains few elements?
Thanks in advance.
Anthony
------------------------------
Date: 2 Aug 2000 00:52:17 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: On upgrading Perl...
Message-Id: <8m7nrh$6ia$1@orpheus.gellyfish.com>
On Tue, 01 Aug 2000 14:55:52 GMT Greg Bacon wrote:
> In article <3986D511.85E40E77@bownemgmt.com>,
> Mike Styne <mstyne@bownemgmt.com> wrote:
>
> : I've checked online, and in the FAQ's -- but I can't seem to find the
> : surefire way to upgrade a system from Perl 5.005_03 to 5.6.0. It seems
> : that previous versions of Perl installed to /usr/bin and 5.6.0 installs
> : to /usr/local/bin. Annoying, to say the least.
>
> Set the prefix, e.g., `Configure -Dprefix=/usr -des`. Changing the
> default to /usr/local on Linux (possibly other platforms too) wasn't
> an accident. Many Linux distributions put their specially configured
> perls in /usr/bin. Installing over the distribution perl could cause
> problems if you aren't careful.
>
I deliberately uninstalled the Red Hat distributed 5.00503 before building
5.6.0 - this of course did necessitate the rebuilding of Apache and sundry
other software. But hey it works fine.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Wed, 02 Aug 2000 09:35:47 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: On upgrading Perl...
Message-Id: <0rqfos0a82pggpsekp3au2rd0cjoj5402u@4ax.com>
Mike Styne wrote:
>I would assume it would be wisest to just keep the distribution's
>installation intact and wait until Perl 6 to upgrade.
Don't hold your breath. It's going to be a long wait.
--
Bart.
------------------------------
Date: Wed, 02 Aug 2000 07:06:11 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: password protected web pages
Message-Id: <MPG.13f265c1b2ffacb398969e@news>
Diane writes ..
>Any suggestions for some good references for perl scripts which restrict
>access to certain parts of a website? What I need to do is find/write a perl
>script that will allow the user to choose a username and password as part of
>a registration form, and get immediate access to those pages. The user
>should also have the ability to have the password send I've used the
>authenticate program from Matt Wright & Craig Patchett's "CGI/Perl
>Cookbook", but was wondering what else is available. Any perl modules that
>would be helpful in writing my own script? I looked through the perl module
>list and didn't see anything but maybe I missed something.
perldoc -f crypt
perldoc -f open
perldoc -f print
and look up the 'eq' and '<>' operators in
perldoc perlop
of course you should be using the (usually) built in authentication
mechanism of your web server - but you'd need to ask in a different
group (or read perlfaq9) for how to do that
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 2 Aug 2000 00:43:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: password protected web pages
Message-Id: <8m7nbk$4u9$1@orpheus.gellyfish.com>
On Mon, 31 Jul 2000 15:50:14 -0400 Diane wrote:
> I've used the
> authenticate program from Matt Wright & Craig Patchett's "CGI/Perl
> Cookbook"
>
Well don't do that.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Wed, 02 Aug 2000 08:45:54 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl - w (PROBLEM) BUG?????
Message-Id: <6dRh5.873$82.45377@news.dircon.co.uk>
On Tue, 01 Aug 2000 22:09:38 GMT, jffuller@my-deja.com Wrote:
> I hope somebody can help me with this problem. I'm having problem
> compiling perl though my Apache Web server.. It's very strange I
> Installed the latest version of perl on my server (RedHat v. 6.2) and
> to run a program I can't use the usual: #!/usr/local/bin/perl
>
> I have to use with comments e.g.
> #!/usr/local/bin/perl -w
>
> When I use the above header everything works correctly, ????????
>
I would say that you have got some wierd crap at the end of the line.
/J\
------------------------------
Date: 2 Aug 2000 00:30:39 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Perl CGI - files occasionally truncated
Message-Id: <8m8blv$d1q$1@provolone.cs.utexas.edu>
In article <8m7il6$imo$1@nnrp1.deja.com>, <mikelot@my-deja.com> wrote:
>Regarding MySQL - in my case, users want to be able to do a text search
>of the records for matching keywords (ie almost like a grep),
Standard SQL allows you to search text fields using rudimentary pattern
matching (using the keyword "LIKE"). MySQL even extends this and lets
you use regular expressions (using the keyword "REGEXP"). Of course,
you don't want to use either one if you want speed.
In effect, you can emulate grep pretty closely by doing this SQL:
select mytextfield from mytable where mytextfield regexp "pattern"
> so I
>didn't think MySQL would be that much benefit. But not having used it,
>I could be way off base! Seems like I'd have to build some sort of
>indexing system to make it useful in this particular application.
An indexing system might not be very difficult to make at all.
Imagine you have one table called "thingy", and it looks like this:
thingy_id thingy_text
--------- -----------
1 "the quick brown fox jumps"
2 "over the lazy dog"
All you have to do is parse each thingy_text and break it up into
words. Then, make entries in another table (called "thingyindex") for
each word that you see:
thingyindex_id thingyindex_word thingy_id
-------------- ---------------- ---------
1 "the" 1
2 "quick" 1
3 "brown" 1
4 "fox" 1
5 "jumps" 1
6 "over" 2
7 "the" 2
8 "lazy" 2
9 "dog" 2
The great thing about databases is that you can then put an extra index
on the column "thingyindex_word" and the database will keep its own
index that helps you scan that column very quickly. So then, you tell
the SQL server to give you back all the rows with a "thingyindex_word"
matching "the" or "quick", and you get back a list of "thingy_id"s,
which you can use to score results and index back into the "thingy"
table.
Actually, all you have to do once you've built the index is
do this SQL statement:
select count(*) as score,thingy_id
from thingyindex
where thingyindex_word in ("the", "quick")
group by thingy_id
order by score DESC
When you do that, you not only get back the ids of the matching rows,
you get them back with scores and in order by score.
Heck, you can even get more elaborate and do the SQL so that
it gives you back the text entries as well:
select count(*) as score, thingy.*
from thingyindex join thingy
where thingyindex_word in ("the", "quick")
and thingyindex.thingy_id = thingy.thingy_id
group by thingy_id
order by score DESC
For the above example, this will actually give you back this:
score thingy_id thingy_text
----- --------- -----------
2 1 the quick brown fox jumps
1 2 over the lazy dog
Anyway, I'm getting really elaborate here. The point is that building
an index is probably not that bad a thing to do because suddenly your
searches become amazingly easy and fast.
Of course, you'd still have to worry about case sensitivity and all
that, but it's really not very painful. Just convert everything to
lowercase (and delete extra characters) when building and matching
against the index, and you're done. It's not even very hard to build
the index -- just add those entries to the index table whenever you add
a row to the table it's an index for (and delete when you delete too).
One more thing I should note: some database people will cringe at the
idea that I have the same text in the same field in two different rows
(the text "the" occurs twice in the "thingyindex" table). This can
easily be fixed by having a cross-reference table. In that case, each
word occurs in "thingyindex" only once and each row of the cross
reference table simply lists an id from each of the other tables that
can be used to match them up.
- Logan
------------------------------
Date: Wed, 02 Aug 2000 07:45:26 +0100
From: Kevin Dobson <kevin@dnc-electronics.co.uk>
Subject: Perl for automating (web) isp backend
Message-Id: <3987C386.A6BE0781@dnc-electronics.co.uk>
Hello,
I am about to embark on automating my backend y'know
sendmail,ftp,apache,dns,~passwd,~shells etc - probably 10-15 files.
obviously some files are dbm hashes
aliases/virtusertable etc
most are text files.
httpd.conf could use a standard virtualserver file (like mandrake 7)
with variables for domain names
which would use data from dns at the end instead of adding text to end
of document and apache parsing it
dns is the trickiest
1, I need something to querie network solutions and maybe others then
automatically submit their doc with my dns info. (for hosting)
2, Then my dns files need to be updated.
Their might be tools for this
Another problem is running some scripts in website although
invoking perl or using mod_perl might be a way to do this
and then their's security issues.
In other words this is a portal system.
Anyone who has experience doing this or could maybe help me implement
this for money
i would like to hear from them.
Good perl text handling skills a neccesity!
Best Regards
Kevin
------------------------------
Date: 2 Aug 2000 00:20:18 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Web Security
Message-Id: <8m7lvi$dk$1@orpheus.gellyfish.com>
On Tue, 01 Aug 2000 10:20:07 -0600 Travis Stevens wrote:
> Hello people!
>
> Could someone recommend a website that outlines the do's and don't of
> putting perl scripts on the web.
>
<http://www.w3.org/Security/Faq/>
<http://www.go2net.com/people/paulp/cgi-security/safe-cgi.txt>
You might also want to look at CERT <http://www.cert.org>
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 2 Aug 2000 09:21:19 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perldoc error
Message-Id: <8m8llv$qb$1@orpheus.gellyfish.com>
On Tue, 01 Aug 2000 17:10:57 +0200 Timpie wrote:
> Recently installed perl v5.6 (via cpan) and now every time I invoke
> perldoc I get the following error :
>
> Superuser must not run /usr/local/bin/perldoc without security audit and
> tainted checks
>
> Any ideas ? Is it a compilation issue ?
No this is intentional behaviour, quite simply dont run it as root, if
you arent running it as root then either the program has been made setuid
somehow or there is something awfully wrong with your system. If you *must*
run it as run the perhaps you might make it setuid to an unprivileged user.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 2 Aug 2000 00:12:49 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: posting in newsgroup using perl script?
Message-Id: <8m7lhh$um0$1@orpheus.gellyfish.com>
On Tue, 01 Aug 2000 16:19:14 +0200 Ron wrote:
> Thanks for your example; I tried to run it, but I get an error:
>
> "Can't find string terminator "EOMESS" anywhere before EOF at ./sendnews.cgi line
>
> 10. "
>
> I can't find out how to fix this; do you know how to fix this?
>
Dont stupidly cut and paste stuff from usenet posts. The file I copied
into my post ran perfectly fine.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Wed, 02 Aug 2000 08:57:06 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: posting in newsgroup using perl script?
Message-Id: <CnRh5.875$82.45377@news.dircon.co.uk>
On Tue, 01 Aug 2000 19:24:59 GMT, Bart Lateur Wrote:
> Abigail wrote:
>
>>,, > my @message = split /\n/,<<`EOMESS`;
>> ^ ^ That of course starts up a shell.
>
> Jeezes! JNS, what were you thinking...
>
How truly bizzare, I thought I *had* tested it - but I was on the train
without a news-server at the time so hey ...
For the record that line should be :
my @message = split /\n/,<<'EOMESS';
/J\
------------------------------
Date: Wed, 02 Aug 2000 10:06:27 +0100
From: Jill Waters <waters@gfms.bt.co.uk>
Subject: Problems with require
Message-Id: <3987E493.88ED302C@gfms.bt.co.uk>
I am using both packages and library files.
In my main program I have:
require "alibrarayfile.pl";
use APackage;
In APackage.pm I also need to include alibraryfile.pl so have
require "alibraryfile.pl";
What appears to be happening is that at compile time alibraryfile.pl is
loaded into the APackage.pm namespace OK. However, at run-time
alibraryfile.pl is not loaded into the main namespace - because Perl
thinks it has already been loaded perhaps?
Am I doing something wrong? If not, how do I use a library file in both
main and in a package?
Jill
------------------------------
Date: Wed, 02 Aug 2000 10:10:48 +0100
From: Jill Waters <waters@gfms.bt.co.uk>
Subject: Problems with require
Message-Id: <3987E598.5D027289@gfms.bt.co.uk>
I am using both packages and library files.
In my main program I have:
require "alibrarayfile.pl";
use APackage;
In APackage.pm I also need to include alibraryfile.pl so have
require "alibraryfile.pl";
What appears to be happening is that at compile time alibraryfile.pl is
loaded into the APackage.pm namespace OK. However, at run-time
alibraryfile.pl is not loaded into the main namespace - because Perl
thinks it has already been loaded perhaps?
Am I doing something wrong? If not, how do I use a library file in both
main and in a package?
Jill
------------------------------
Date: Wed, 2 Aug 2000 08:25:52 +0100
From: "Philip Taylor" <phil.taylor@bigfoot.com>
Subject: Re: question about a Regular Expression
Message-Id: <8m8idp$9ec$1@news6.svr.pol.co.uk>
Greg Bacon <gbacon@HiWAAY.net> wrote in message
news:sobq96ug9ft7@corp.supernews.com...
> I would write
>
> if (/^\s* \d\d? \s*-\s* \d\d? \s*$/x) {
> ...;
> }
What does the x on the end do?
> or maybe
>
> if (/^\s* # optional leading whitespace
> \d\d? # one- or two-digit score
> \s*-\s* # dash separator (with optional whitespace)
> \d\d? # one- or two-digit score
> \s*$/x) # optional trailing whitespace
> {
> ...;
> }
Why does the dash not need escaping above?
------------------------------
Date: Wed, 02 Aug 2000 08:23:40 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: question about a Regular Expression
Message-Id: <slrn8ofmbd.61h.bernard.el-hagin@gdndev25.lido-tech>
On Wed, 2 Aug 2000 08:25:52 +0100, Philip Taylor
<phil.taylor@bigfoot.com> wrote:
>
>Greg Bacon <gbacon@HiWAAY.net> wrote in message
>news:sobq96ug9ft7@corp.supernews.com...
>
>> I would write
>>
>> if (/^\s* \d\d? \s*-\s* \d\d? \s*$/x) {
>> ...;
>> }
>
>What does the x on the end do?
RTFM - "perldoc perlop".
>> or maybe
>>
>> if (/^\s* # optional leading whitespace
>> \d\d? # one- or two-digit score
>> \s*-\s* # dash separator (with optional whitespace)
>> \d\d? # one- or two-digit score
>> \s*$/x) # optional trailing whitespace
>> {
>> ...;
>> }
>
>Why does the dash not need escaping above?
Why should it be? It has no special meaning outside of a character
class.
Bernard
--
perl -le 'open(JustAnotherPerlHacker,"")or$_="B$!e$!r$!n$!a$!r$!d$!";
print split/No such file or directory/;'
------------------------------
Date: Wed, 02 Aug 2000 07:10:09 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: question about the insert sql command.
Message-Id: <MPG.13f266b3ea29890a98969f@news>
Steve Pass writes ..
>I'm trying to create a script that gets a hostname from a database, telnet's
>to the device and gets some information and puts it back into the database.
>My problem is putting the returned information back into the same table as
>the requested device. The requested device is set as the primary key. I'm
>using the INSERT command, but it appears that I cannot write to the table,
>however if I create a new table the command works. Is there a way to write
>this information to the same table? Here is an example of the code I'm using
>for the Insert command. Quick general info. This is on a Winnt, going to an
>access database, the database is called Hosts and the table is called
>tblHostID, which contains two fields: Hostname and Version. TIA!
>
>(I edited quite a bit out to get to the jist of it.)
>
>my($db) = new Win32::ODBC('Hosts');
>$db->Sql("SELECT Hostname FROM tblHostID");
>while ($db->FetchRow()) {
> my(%data) = $db->DataHash();
> my($prompt);
> use Net::Telnet;
> $t->open(Host => $data{'Hostname'});
> $t->print("sh ver");
> @info = $t->getlines;
>my($stat) = new Win32::ODBC ('Hosts');
> $sql = "INSERT INTO tblHostID (Version) VALUES ('$info[1]');";
> $stat->Sql($sql);
there's nothing wrong with your Perl code (as you seem to know judging
by your subject) .. so perhaps you need to ask the question in an SQL
related newsgroup
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Wed, 02 Aug 2000 09:38:43 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: question about tr
Message-Id: <4vqfosk89dbdlf7q45iud8v7vsqfus5j40@4ax.com>
T. Postel wrote:
>>Because it creates a range ' ' to '_', which is a whole lot of
>>characters! :-)
>>
>>Moving the '_' to the front puts the '-' at the end, so is loses its
>>metasemantics.
>>
>Man I am so dumb!
>Thanks one and all, I just didn't see the trees for the forest.
It's not dumb. I ALWAYS put a backslash in front of my "-" in the LHS of
tr///, no matter where it is located. I wish this was required.
--
Bart.
------------------------------
Date: 1 Aug 2000 23:59:10 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: relative to absolute Hyperlink-URL
Message-Id: <8m7knu$s1r$1@orpheus.gellyfish.com>
On Tue, 01 Aug 2000 20:03:56 +0200 Andreas Greuer wrote:
> Hello,
>
> Some weeks ago I asked this question. But the answers couldn't
> help.
> So I try again.
>
30th March to be precise some *months* ago I would suggest ;-}
> I want to exchange relative URLs in a HTML-Document into
> absolute.
<big snip>
You can use HTML::Parser to obtain the URLs from the document and the
module URI to make them absolute.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Wed, 2 Aug 2000 17:53:30 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: relative to absolute Hyperlink-URL
Message-Id: <lSQh5.1$ZR.416@vic.nntp.telstra.net>
Andreas Greuer <greuer@gmx.de> wrote in message
news:3987110C.58BBE0D4@gmx.de...
> Hello,
>
> Some weeks ago I asked this question. But the answers couldn't
> help.
> So I try again.
>
> I want to exchange relative URLs in a HTML-Document into
> absolute.
>
>
> Thanks to helpers
> Andreas
>
I seemed to have some success with the following (using the example you
gave).
while (<DATA>){
s|=(?!("?)http)"?/?([\w./]+)"?|="http://www.irgendwo.de/$2"|g;
}
__END__
<html><head></head><body>
<a href="http://www.irgendwo.de/seite.html"><img SRC="bild.gif"></a>
<a href ="bild2.gif"><img SRC=bild.gif></a>
<a href=Seite.html>Seite</a>
<a href=/Seite2.html>Seite2</a>
<a href=http://www.irgendwo.de><img SRC =
http://www.irgendwo.de/bild.gif></a>
</body></html>
Definitions of "Success" may vary.
Wyzelli
------------------------------
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 3880
**************************************