[10955] in Perl-Users-Digest
Perl-Users Digest, Issue: 4556 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 5 16:07:15 1999
Date: Tue, 5 Jan 99 13:00:29 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 5 Jan 1999 Volume: 8 Number: 4556
Today's topics:
Re: [OT] email address == passwd (Was: Re: OK I give up (Abigail)
Re: a problem! <staffan@ngb.se>
Re: a problem! <dgris@moiraine.dimensional.com>
Any good docs on maintaining Perl distributions? <trudej00@mh.us.sbphrd.com>
Re: background server (Mads Toftum)
basic query about command line processing in Perl <tkkb@morrita.freeserve.co.uk>
Re: bulletin board w/o registering <wil@calweb.com>
comp/comp3 numbers in Perl or maybe C aixgod@ix.netcom.com
Excel to HTML converter? (Damon K. Haley)
Re: Excel to HTML converter? <staffan@ngb.se>
Re: EXPERIENCED IN PERL ? (Craig Berry)
Re: EXPERIENCED IN PERL ? (Craig Berry)
Exstract a word from file <marilena@wms.it>
Re: Getting at stderr (Andrew M. Langmead)
Re: hash of hashes <netog@ziplink.net>
Re: How to redistribute ActiveState's Perl (Charles Wilt)
I don't know ANYTHING <wil@calweb.com>
lwp-rget and lwp-mirror: anyone merged them ? <dickens@dreamgear.com>
Making .exe in NT <iblake@kodak.com>
Re: mod_perl and database connections (Abigail)
Re: New posters to comp.lang.perl.misc (Greg Bacon)
Re: OK I give up (After a WEEK!) (Abigail)
Opening remote file <famruud@online.no>
Re: Opening remote file <dgris@moiraine.dimensional.com>
Re: Package privacy problem (M.J.T. Guy)
Passing vars to HTML::Parser/globals with strict/link c <crism@oreilly.com>
Re: Passing vars to HTML::Parser/globals with strict/li <crism@oreilly.com>
Re: Path under windows <jwarner@tivoli.com>
Re: PERL and permissions (Abigail)
Re: PERL and permissions <alejandro.eluchans@umb.edu>
Perl BEGIN failed--compilation aborted <ys001-1@dial.oleane.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Jan 1999 20:06:13 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: [OT] email address == passwd (Was: Re: OK I give up (After a WEEK!))
Message-Id: <76trbl$e0k$4@client3.news.psi.net>
James Ludlow (ludlow@us.ibm.com) wrote on MCMLIII September MCMXCIII in
<URL:news:36922C64.F1AF729B@us.ibm.com>:
`` Marc Austin wrote:
`` > if Joe loses his password, I want him to be able to request it again
`` > using a simple online form...
``
`` > Joe will submit his email address (requesting his lost password)
`` > the script will look to see if it's in the temp.txt file. if Joe
`` > Blows email address is in the text file then email joe his password...
``
`` Of course, this means that the passwords are now actually the email
`` addresses themselves. Basically, if someone knows an email address,
`` they can get the password for free.
Ah, yes. Except that the password will be mailed to the given email
address.
Abigail
------------------------------
Date: Tue, 05 Jan 1999 20:40:10 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: a problem!
Message-Id: <36926A9A.E0E364A6@ngb.se>
> In article <36914F7A.936B5DF8@ngb.se>, staffan@ngb.se pounded in the
> following:
> => print ANOTHERFILE @paragraphs[0];
>
> print ANOTHERFILE $paragraphs[0];
Eh, sorry. :-(
Maybe I should start reading through my posts before I send them. That
doesn't sound like a bad idea.... Nah, why bother: nobody else does...
;-)
------------------------------
Date: 05 Jan 1999 12:46:57 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: a problem!
Message-Id: <m31zl98pu6.fsf@moiraine.dimensional.com>
Staffan Liljas <staffan@ngb.se> writes:
> Maybe I should start reading through my posts before I send them. That
> doesn't sound like a bad idea.... Nah, why bother: nobody else does...
> ;-)
Because nobody else reads your posts before you send them you aren't
going to either? Odd. :-)
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Tue, 05 Jan 1999 13:07:08 -0500
From: Jon Trudel <trudej00@mh.us.sbphrd.com>
Subject: Any good docs on maintaining Perl distributions?
Message-Id: <369254CB.6F43A034@mh.us.sbphrd.com>
I've searched the newsgroups, and looked through the perl FAQs at perl.org,
and I haven't really come across any single document that talks about
managing a Perl distribution. I've got several different architectures to
maintain, and I've seen some things about acquiring Perl and installing
modules, but nothing much that's on a higher level than nuts -n- bolts
items.
Does such a document exist? If so, please give me a pointer. Thanks!
Jon Trudel
------------------------------
Date: Tue, 05 Jan 1999 20:11:59 GMT
From: mt@dev.null (Mads Toftum)
Subject: Re: background server
Message-Id: <369371b6.4651463@news.inet.tele.dk>
On 5 Jan 1999 00:34:56 GMT, ehammerv@tricity.wsu.edu (Eric Hammervold)
wrote:
>Hello
>
>I need some information on generating background servers for windows NT. Specificly
Try taking a look at the module Proc::Background, it is supposed to
work on NT also. Works quite well on unix.
vh
Mads Toftum, QDPH
som pe USENET reprfsenterer sig selv og ingen andre.
------------------------------
Date: Tue, 5 Jan 1999 20:22:08 -0000
From: "Tom Morris" <tkkb@morrita.freeserve.co.uk>
Subject: basic query about command line processing in Perl
Message-Id: <76tsit$ec3$1@news7.svr.pol.co.uk>
can someone please help me out here. I'm a bit new to Perl and desparately
need to know how to process command line args.
eg if I have a program called myprog.plx and called it as
myprog.plx abc def ghi
and I wanted the output to be ..
there were 3 arguments passed
arg1 = abc
arg2 = def
arg3 = ghi
this is using Perl on windows NT 4 (it comes with the resource kit). I hope
that this is as easy as it would be using the UNIX shell.
many thanks in advance, Tom
------------------------------
Date: Tue, 5 Jan 1999 12:04:11 -0800
From: "FREED" <wil@calweb.com>
Subject: Re: bulletin board w/o registering
Message-Id: <3692e58e.0@news1.jps.net>
I don't know if this would help, being that I don't know ANYTHING, but there
is a script at http://www.worldwidemart.com/scripts/wwwboard.shtml for a www
board that's pretty much like a chat room...it's pretty cool, you can see it
in action at http://www.beastieboys.com/wwwchat/ I hope this helps you out.
------------------------------
Date: Tue, 05 Jan 1999 19:20:25 GMT
From: aixgod@ix.netcom.com
Subject: comp/comp3 numbers in Perl or maybe C
Message-Id: <76tolm$kh2$1@nnrp1.dejanews.com>
I'm trying to write out a data file from Perl (on unix) that the mainframe
guys are telling me needs to have a "comp3" number in it (I think this is
also called a Cobol signed comp-3 number maybe). What I'm encoding is
actually a date listed as "julian packed" on my little sheet of info here,
for that's worth. Clearly, I have little idea what these numbers are or how
to make one....I'm just throwing this post out here in hopes that someone has
some code that will do the conversion. I'd like to write this number out
from Perl, but I'll use C if necessary.
Additionally, for a separate file that will eventually be loaded into DB2 on
the mainframe, I need to write out a normal "comp" number (not comp3),
whatever that is. Any help here would be appreciated to.
I'm hoping that if I select binary format on the ftp to the mainframe that
none of this data will get distorted or converted on the way up....
Thanks for any assistance!
Dylan Tynan
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 5 Jan 1999 19:28:40 GMT
From: dhaley@infobeat.com (Damon K. Haley)
Subject: Excel to HTML converter?
Message-Id: <slrn794puk.als.dhaley@dhcp132.corp.merc.com>
Hello,
Is there an excel to html converter out there?
I found MSWordview which does a great jobs
of converting Word97 to html.
http://www.gnu.org/~caolan/docs/MSWordView.html
I also found this page (http://arturo.directmail.org/filters/)
of MS converters but didn't find an excel2html
converter that is available yet.
Does anyone know of one or when one will be released?
Thanks
Damon Haley
------------------------------
Date: Tue, 05 Jan 1999 21:13:17 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Excel to HTML converter?
Message-Id: <3692725D.5B418868@ngb.se>
> Is there an excel to html converter out there?
Why not just export to CSV and write a quick script (prediction ~ 25
lines)
Staffan
------------------------------
Date: 5 Jan 1999 19:46:02 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: EXPERIENCED IN PERL ?
Message-Id: <76tq5q$cnp$2@marina.cinenet.net>
GSX (gsx97@usa.net) wrote:
: I'm presently writing a Perl Coffee Maker. I've got the code to brew a
: great cup of Hazelnut...but I'm having a problem with the code for
: decaf.
:
: Will this make me ineligible for the job?
No, but since it concerns Java, it's off-topic for this newsgroup.
--
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "The hills were burning, and the wind was raging; and the
clock struck midnight in the Garden of Allah."
------------------------------
Date: 5 Jan 1999 19:45:07 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: EXPERIENCED IN PERL ?
Message-Id: <76tq43$cnp$1@marina.cinenet.net>
Jonathan Feinberg (jdf@pobox.com) wrote:
: Dawg Master <dawgmaster@earthlink.net> writes:
:
: > PERL PROGRAMMER
: > Very experienced in Perl and Linux Red Hat. Must be able to create
: > anything we need in Perl
:
: "For example, we need a program to determine the optimum route for our
: traveling salesmen.
That one is trivial to *write*. Running it (to completion) is easy, too,
for small N...
: Also, we are writing debugging tools, and we'll
: need you to write a program that can determine whether another program
: will halt. Salary commensurate with results."
:) Actually, though, I've always had a small philosophical objection to
the standard proof of the HP's insolubility. Must remember to post it
somewhere appropriate at some point, just to find out what I'm not seeing
properly.
--
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "The hills were burning, and the wind was raging; and the
clock struck midnight in the Garden of Allah."
------------------------------
Date: Tue, 5 Jan 1999 21:18:04 +0100
From: "Interbusiness" <marilena@wms.it>
Subject: Exstract a word from file
Message-Id: <76trae$i95$1@fe2.cs.interbusiness.it>
I need to extract a word from file .
I have a Text file " Pippo.txt" I wrote in it :
I go in England
End of file.
How can I exctract only the word "go" or Only the word England ???
----------------------
If you know how, please send me the script. Thanks in Advance
------------------------------
Date: Tue, 5 Jan 1999 20:44:36 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Getting at stderr
Message-Id: <F53tMC.3HB@world.std.com>
aml@world.std.com (Andrew M. Langmead) writes:
>You might want to look at the FAQ entry "How can I capture STDERR from
>an external command?" <URL:http://www.perl.com/CPAN/doc/manual/html
>/pod/perlfaq8/How_can_I_capture_STDER_from_an.html>
I just looked over that FAQ entry again, and I just noticed that they
removed an interesting section from the older FAQ. It shows how to use
capture both standard output and standard error, while still being
able to differentiate between the two.
>Here's a way to read from both of them and know which descriptor
>you got each line from. The trick is to pipe only STDOUT through
>sed, which then marks each of its lines, and then sends that
>back into a merged STDOUT/STDERR stream, from which your Perl program
>then reads a line at a time:
>
> open (CMD,
> "(cmd args | sed 's/^/STDOUT:/') 2>&1 |");
>
> while () {
> if (s/^STDOUT://) {
> print "line from stdout: ", $_;
> } else {
> print "line from stderr: ", $_;
> }
> }
--
Andrew Langmead
------------------------------
Date: Tue, 05 Jan 1999 15:28:11 -0500
From: Ernesto Gianola <netog@ziplink.net>
Subject: Re: hash of hashes
Message-Id: <369275DB.2BDC7BD@ziplink.net>
Abigail wrote:
> No. Everything in Perl has one value. And if you mean "can I assign
> an array", the answer is no as well. `$hash {$key1} {$key2}' starts
> with a `$', hence, it's a scalar.
> What do you mean "it doesn't work"? It works for me. [@values] is a
> scalar.
I had problems doing this with a tied hash but no more.
Thanks.
Ernesto
------------------------------
Date: 5 Jan 1999 20:40:50 GMT
From: charles.0272@worldnet.no.spam.att.net (Charles Wilt)
Subject: Re: How to redistribute ActiveState's Perl
Message-Id: <MPG.10fc469c667952489896b1@netnews.worldnet.att.net>
In article <369183F9.F0ED4FC4@cls.uob.com.sg>, tpg@cls.uob.com.sg says...
> I am supporting 40-50 NT machines here which all use Perl. The latest
> ActiveState version of Perl is really looking nice. However, the "base"
> perl from them is not quite sufficient for our needs.
>
> ppm is a very nice solution for maintaining the "master" version of
> Perl. However, because our Internet connectivity is eractic enough, I
> don't want to use ppm to add additional packages once the new version of
> Perl is installed.
>
> I'm interested in hearing how others have solved this problem. I've got
> a few ideas on how I might easily distribute my own collection of
> ActiveState perl stuff, but I'd like to hear how others have tackled
> this problem.
>
> TIA
>
> --
> ================================================================
> Terry Gliedt tpg@cls.uob.com.sg http://www.hps.com/~tpg/
> United Overseas Bank Personal Email: tpg@hps.com
>
>
>
I also would like to hear what others have done with this. PPM is fine
for maintaining Perl on my machine. However, I have two other systems I
want to run Perl on that do not have Internet connections.
--
Charles Wilt
Miami Luken, Inc.
e-mail: charles.0272@worldnet.no.spam.att.net
--->remove the no.spam.
------------------------------
Date: Tue, 5 Jan 1999 11:37:27 -0800
From: "FREED" <wil@calweb.com>
Subject: I don't know ANYTHING
Message-Id: <3692df43.0@news1.jps.net>
This is a multi-part message in MIME format.
------=_NextPart_000_0019_01BE389F.C5646880
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I'm a complete numbskull when it comes to programming. Would someone =
please take pity on me and help me to understand the wonders of the Perl =
language? I'm interested in learning Perl, possibly C? I'm not sure =
though being that I don't know anything about them. What is it that =
makes Perl so great? What ways do you use it? I'm curious! Please =
help! Send e-mail to professorbooty1@hotmail.com Thanks so much.
------=_NextPart_000_0019_01BE389F.C5646880
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#f4f4f4>
<DIV><FONT color=3D#000000 size=3D2>I'm a complete numbskull when it =
comes to=20
programming. Would someone please take pity on me and help me to=20
understand the wonders of the Perl language? I'm interested in =
learning=20
Perl, possibly C? I'm not sure though being that I don't know =
anything=20
about them. What is it that makes Perl so great? What ways =
do you=20
use it? I'm curious! Please help! Send e-mail to <A=20
href=3D"mailto:professorbooty1@hotmail.com">professorbooty1@hotmail.com</=
A> =20
Thanks so much.</FONT></DIV></BODY></HTML>
------=_NextPart_000_0019_01BE389F.C5646880--
------------------------------
Date: Tue, 5 Jan 1999 16:03:31 -0500
From: "Jeff Dickens" <dickens@dreamgear.com>
Subject: lwp-rget and lwp-mirror: anyone merged them ?
Message-Id: <76tucv$n1k@news-central.tiac.net>
Hi. Does anyone have a version of lwp-rget that checks the headers to not
download files that have already been downloaded ?
I've read the lwp-rget and lwp-mirror scripts and it seems possible, but
non-trivial to merge them. But I'd rather not reinvent the wheel. Anyone
done it ?
------------------------------
Date: 5 Jan 1999 19:37:13 GMT
From: "Ian Blake" <iblake@kodak.com>
Subject: Making .exe in NT
Message-Id: <01be38e2$c183b070$3282dd96@ko-gipd-w8gnlg7>
Yesterday I was reading somewhere about how to complie a PERL script so it
can run on an computer (PC) regardless of whether or not PERL was
installed. Now I can't find where I was looking. Could someone point me
in the direction to look or help me out with doing it? Thanks.
Ian Blake
iblake@kodak.com
------------------------------
Date: 5 Jan 1999 18:55:20 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: mod_perl and database connections
Message-Id: <76tn6o$d8j$2@client3.news.psi.net>
corus (corus@my-dejanews.com) wrote on MCMLII September MCMXCIII in
<URL:news:369120C6.FE440071@my-dejanews.com>:
!! Hi all.
!!
!! I have a bunch of cgi scripts that get invoked by Apache and talk to a
!! database.
!! (How unusual!!!)
!!
!! I was recently reading about mod_perl and the wonders it can do,
!! especially in cases of scripts with high overheads.
!! The text went on to say that mod_perl is particularly beneficial to
!! database accessing scripts, as connections don't need to be closed but
!! are reused through successive invocations, as the script never really
!! dies.
!!
!! Here's the question:
!! What happens with database connections (or other shared resources) if
!! two invocations take place at the same time?
That of course depends on your database. Any reasonable database of
course allows for hundreds, if not thousands, of simultanious connections.
!! Would I have to provide some sort of 'database connection' locking
!! mechanism so that the second request doesn't try to use the same
!! connection as the first one is using?
Again, that depends on your database. I'd pick one where I wouldn't have
to worry about stuff like that; but then, I stay out of poison ivy as well.
!! Do I in general open a number of database connections on startup and
!! keep them waiting for clients?
Again, that depends on your database, whether it gives you an improvement,
and the drawbacks this approach has.
Abigail
------------------------------
Date: 5 Jan 1999 20:49:27 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: New posters to comp.lang.perl.misc
Message-Id: <76ttso$50f$2@info.uah.edu>
In article <MPG.10fbfc8421a6fd319898f6@nntp.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) writes:
: But note that the adjective 'original' has two disparate meanings that
: could be applied in this context:
:
: 2b: constituting that from which a copy, reproduction, or translation is
: made
: 3: independent and creative in thought and action
:
: The original(2b) submission that I have reproduced above makes it clear
: that the meaning intended for OCR is Original(3) Content Rating. But it
: could easily have been misinterpreted (as I have done until now).
The OCR is an indication of what portion of the traffic is original
(where original lines are lines that don't match the quoting regular
expression). Of course, this doesn't take into account unoriginal
content like
The ability to quote is a serviceable substitute for wit.
-- Maugham
I don't think `new' really captures the essence of what I'm after. Of
course, it would be simpler to report Quoted Content Ratio, but I don't
like going around measuring how empty glasses are. If someone were to
give me an adjective that is better at indicating `not generated by the
quoting mechanism of a newsreader', then I'd be happy to use it. I'd
also like it to sound better than Unquoted.
Greg
--
The earth has become small, and on it hops the last man, who makes
everything small. His species is ineradicable as the flea; the last
man lives longest.
-- Nietzsche
------------------------------
Date: 5 Jan 1999 19:00:10 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: OK I give up (After a WEEK!)
Message-Id: <76tnfq$d8j$3@client3.news.psi.net>
Marc Austin (placeit@easyad.com) wrote on MCMLIII September MCMXCIII in
<URL:news:placeit-0401992224420001@blv-lx100-ip18.nwnexus.net>:
@@
@@
@@ Here's what I have, but when I get to the print statement, it is
@@ printing the last line in the file, not the line containing
@@ joeblows email address.
@@
@@ #!/usr/bin/perl
Change this to #!/usr/bin/perl -w, and perl itself will tell you what
you did wrong!
Abigail
------------------------------
Date: Tue, 5 Jan 1999 21:06:36 +0100
From: "Henrik Ruud" <famruud@online.no>
Subject: Opening remote file
Message-Id: <76tre0$dc1$1@readme.online.no>
How do I open a file from ANOTHER SERVER into a variable in a perl-script?
Henrik Ruud
------------------------------
Date: 05 Jan 1999 13:15:50 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Opening remote file
Message-Id: <m3r9t979xl.fsf@moiraine.dimensional.com>
"Henrik Ruud" <famruud@online.no> writes:
> How do I open a file from ANOTHER SERVER into a variable in a perl-script?
Depends. Do you want to use ftp, http, nfs, smb, windows share, telnet,
rlogin, gopher, or ssh? The question as asked is fairly meaningless.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: 5 Jan 1999 19:20:42 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Package privacy problem
Message-Id: <76toma$oth$1@pegasus.csx.cam.ac.uk>
Aidan Rogers <aidan@salvador.blackstar.co.uk> wrote:
>The constructor looks something like this:
>
>sub new {
> my $that = shift;
> my $class = ref($that) || $that;
> my $self = bless $that->SUPER::new(@_), $class;
> return $self;
>}
>
>The SUPER here is the Foo class, so the object being constructed receives
>some basic methods from Foo.
Without a _complete_ example, it's impossible to say what is going on,
but my guess is that SUPER:: isn't doing what you think it does.
SUPER:: searches in the @ISA *of the current package*, rather than in
the @ISA associated with some particular object.
This isn't made clear in the documentation.
Mike Guy
------------------------------
Date: 05 Jan 1999 12:49:28 -0500
From: Chris Maden <crism@oreilly.com>
Subject: Passing vars to HTML::Parser/globals with strict/link checking
Message-Id: <keww314nkn.fsf@rosetta.ora.com>
I'm writing yet another link checker. This one checks links among a
set of files, including verifying the existince of anchors for
fragment links. I had a primitive one that, for each link, opened the
requested file (if it existed) and checked for the named anchor. But
that was slow, and since I found another bug, I decided to re-write it
with HTML::Parser.
What I'd like to do is scan a set of files, building a list of anchors
and a list of links. After the scan is complete, cross-check the
links against the anchors, reading any additional files that are
referenced. It seems like a good job for a couple of hashes
($links->{$file}->{$anchor} and $names->{$file}->{$name}).
The big problem is getting at the current file. I can't find anything
in the HTML::Parser doc that allows me to ask for the currently-being-
parsed file, and I can't access the $file from main, since (because
I'm trying to be good and use strict;) it's declared with my.
use strict;
{
package linkchek::Parser;
require HTML::Parser;
@linkchek::Parser::ISA = ('HTML::Parser');
my (%names, %links);
sub start {
my ($self, $tag, $attr, $attrseq, $origtext) = @_;
my ($name);
if ($tag eq "a") {
if ($name = $attr->{"name"}) {
# Here's the problem: how can I find out the current file?
$names->{$file}->{$name} = 1;
}
}
}
}
my ($p, $file);
$p = linkchek::Parser->new;
while ($file = shift @ARGV) {
print "$file\n";
$p->parse_file($file);
}
Thanks in advance,
Chris
--
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>
------------------------------
Date: 05 Jan 1999 14:13:46 -0500
From: Chris Maden <crism@oreilly.com>
Subject: Re: Passing vars to HTML::Parser/globals with strict/link checking
Message-Id: <keu2y54jo5.fsf@rosetta.ora.com>
I wrote:
> I'm writing yet another link checker.
>
> The big problem is getting at the current file.
I figured it out: modify the constructor to add the filename to the
$self hash. (This still doesn't run as written because I need to
figure out how exactly to refer to $names and keep strict happy. I
was raised as an electrical engineer, and this object stuff still
confuses me. I'm much happier in Scheme. (-: )
use strict;
{
package linkchek::Parser;
require HTML::Parser;
@linkchek::Parser::ISA = ('HTML::Parser');
my (%names, %links);
sub new
{
my $class = shift;
my $self = bless { '_buf' => '',
'_strict_comment' => 0,
'file' => ''
}, $class;
$self;
}
sub start {
my ($self, $tag, $attr, $attrseq, $origtext) = @_;
my ($name);
if ($tag eq "a") {
if ($name = $attr->{"name"}) {
$names->{$self->{"file"}}->{$name} = 1;
}
}
}
}
my ($p);
$p = linkchek::Parser->new;
while ($p->{"file"} = shift @ARGV) {
$p->parse_file($p->{"file"});
}
-Chris
--
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>
------------------------------
Date: Tue, 05 Jan 1999 10:11:41 -0600
From: John Warner <jwarner@tivoli.com>
Subject: Re: Path under windows
Message-Id: <369239BD.2270BCB8@tivoli.com>
Clinton Pierce wrote:
> On Mon, 04 Jan 1999 15:50:51 -0600, John Warner <jwarner@tivoli.com>
> wrote:
> >An interesting problem. Are you sure they can install the ActiveState build? It
> >certainly would make life easier. If you absolutely have to do this the hard way
> >there are a couple of approaches.
>
> No. These are Microsofties. Remember that at least 50% of ISP's are
> run by scared-shitless, clueless idiots, who couldn't admin their way
> out of a paper bag. They saw the "Make Big Money as an Internet Service
> Provider" in the back of a magazine, and sent away for equipment.
I know where you're coming from. I used to do tech support for an internet chat
software company. Most of their clients had not the first clue to administrating their
machines (NT or Unix). I had one client running an adult site that I had to teach him
how to use the mouse before we got to NT administration.
> >First, if they have a C compiler on the machine,
> >have them download and install the CGI module off CPAN. The installation procedure
> >should be substantially similar to that used on Unix.
>
> I've bought my clues, and this isn't as easy as it sounds. Not at all.
> I'd volunteer to give them a Perl build with all the good modules, but I
> don't pay for software and I don't have a copy of NT or a C compiler for
> Windows 9x laying around. (And frankly, under Win9x CygWin is useless.)
Hmmm. That's odd. It took me a little debugging on pathing in the makefile but other
than that (and using nmake), all the modules I have installed ran like a champ. If you
can persuade them to install the gnu tools (www.gnu.org) as well as gcc, the
instructions you send to them would work regardless of the differences between your
OSes. I did this recently on my laptop for work and I have to say, its pretty groovy
having gcc, a couple of Unix shells, and most of the Unix commands (including make, tar,
and gzip) on my NT Workstation.
> >If all else fails, you can
> >copy the .pm files from the distribution to replace the existing .pm files of the
> >same names. (Make a backup of your originals first!) I've installed modules both
> >ways. The second method is certainly harder because of the verification testing
> >needed to ensure the new .pm files are functioning properly.
>
> This would require them to put files into the directories where Perl is
> installed on the NT server. Again, for distribution/portability this is
> wholly inadaquate. It would be easier to build a custom Perl, and give
> them an Install-Sheilded EXE to re-install Perl with. (Except that
> building Perl with freeware tools is an exercise in insanity.)
That sounds suspiciously like the ActiveState installer. ;-)
> My analysis of what these ISP's are thinking:
>
> They're running their site By The Book. Perl came with Windows
> NT--that's the Perl we use. A CGI program is just that--a program. Not
> a whole suite of modules. ASP doesn't require modules to be wholly
> functional, why should Perl?
>From what you describe, you are probably correct in your analysis (although Perl 5.001
comes with the NT Resource Kit--it's not a standard feature). Trying to explain the
difference between how ASP and Perl work from a technical perspective is likely to be an
exercise in futility and beyond their present abilities. Unfortunately, that puts you
between a rock and a hard place. My advice is to try Timbuktu (free last time I
checked) , tell them to sit quietly and watch, and then install the correct build of
ActivePerl (also free) for them. When they ask why you did that, explain to them that
they needed the upgrade and are now using a newer, superior version of Perl. It may
help to compare it to upgrading from IIS3 to IIS4 or going from a no-option '76 Honda
CVCC (NT Resource Kit Perl) to a nearly fully loaded '99 Cadillac (ActivePerl) which
would put the upgrade in a context to which they can relate. You can also try to
contrast the modular/extensible nature of Perl with the static nature of ASP. Then
charge them out the yingyang for the lesson. ;-)
John Warner
------------------------------
Date: 5 Jan 1999 20:01:42 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: PERL and permissions
Message-Id: <76tr36$e0k$1@client3.news.psi.net>
Alejandro Eluchans (alejandro.eluchans@umb.edu) wrote on MCMLIII
September MCMXCIII in <URL:news:36923A99.A01D38BC@umb.edu>:
-- Does any body know how to change the permission of a PERL script from
-- nobody to a user with full privileges in a particular directory in order
-- to edit and create files using PERL without having to give full
-- permission to nobody.
That's not a perl question but one specific to your OS.
You really don't want to do this though.
Abigail
------------------------------
Date: Tue, 05 Jan 1999 15:30:47 -0600
From: Alejandro Eluchans <alejandro.eluchans@umb.edu>
Subject: Re: PERL and permissions
Message-Id: <36928487.CD513D2@umb.edu>
The OS is a DEC UNIX.
What I'm trying to do is change the permission of a script from within (with a
line of code in the script ... maybe like system(???)) so the script becomes a
particular user.
The reason why I'm trying to do this is so other users (maybe ftp users) can
not change or manipulate the files that the script access.
If this is not a good idea, Why?
Alejandro
Abigail wrote:
> Alejandro Eluchans (alejandro.eluchans@umb.edu) wrote on MCMLIII
> September MCMXCIII in <URL:news:36923A99.A01D38BC@umb.edu>:
> -- Does any body know how to change the permission of a PERL script from
> -- nobody to a user with full privileges in a particular directory in order
> -- to edit and create files using PERL without having to give full
> -- permission to nobody.
>
> That's not a perl question but one specific to your OS.
>
> You really don't want to do this though.
>
> Abigail
------------------------------
Date: Tue, 5 Jan 1999 20:28:35 -0000
From: "Ylan Towernet Communication" <ys001-1@dial.oleane.com>
Subject: Perl BEGIN failed--compilation aborted
Message-Id: <76tp8r$gh7$1@minus.oleane.net>
We have this probleme whit perl when we install perl
Its only install 83%
Can you help us please
# ./perl harness
Can't load '../lib/auto/IO/IO.so' for module IO: ld.so.1: ./perl: fatal:
relocat
ion error: symbol not found: main: referenced in ../lib/auto/IO/IO.so at
../lib/
DynaLoader.pm line 168.
at ../lib/IO/Handle.pm line 248
BEGIN failed--compilation aborted at ../lib/IO/Seekable.pm line 50.
BEGIN failed--compilation aborted at ../lib/IO/File.pm line 111.
BEGIN failed--compilation aborted at ../lib/Test/Harness.pm line 7.
BEGIN failed--compilation aborted at harness line 13.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 V8 Issue 4556
**************************************