[10231] in Perl-Users-Digest
Perl-Users Digest, Issue: 3824 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 25 14:07:34 1998
Date: Fri, 25 Sep 98 11:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 25 Sep 1998 Volume: 8 Number: 3824
Today's topics:
Re: [Fwd: IP Hardware acting as self (from self)] <eashton@bbnplanet.com>
Re: Can't locate loadable object Module? <BobN@interaccess.com>
Re: cat reese > /dev/null (was Re: Perl & Java - differ <uri@camel.fastserv.com>
Re: cat reese > /dev/null (was Re: Perl & Java - differ <jdporter@min.net>
Re: cat reese > /dev/null (was Re: Perl & Java - differ <zenin@bawdycaste.org>
Re: even/odd numbers (Jahwan Kim)
Help compiling <levinsNOSPAM@westnet.com>
Re: help with removing leading zeros with reg-exp (Matt Knecht)
Re: help with removing leading zeros with reg-exp (Larry Rosler)
Re: help with removing leading zeros with reg-exp (Andre L.)
Re: help with removing leading zeros with reg-exp (Mike Stok)
Re: Perl & Java - differences and uses <jdporter@min.net>
Re: Perl & Java - differences and uses <jdane@hawaii.edu>
Re: Perl & Java - differences and uses <jdporter@min.net>
Re: Perl as http User Agent?! (I R A Aggie)
Re: Perl as http User Agent?! <eashton@bbnplanet.com>
Programmierer gesucht! (ChriJa)
Re: Q: Picking an element from a hash (not knowing whic (Mark-Jason Dominus)
Redirection Question <tturton@cowboys.anet-dfw.com>
Re: Regular Expression Operator Precedence (Mark-Jason Dominus)
Re: regular expression (Larry Rosler)
Re: Security problem <support@acuity.com>
Re: two dimensional hashes <zenin@bawdycaste.org>
Re: Unix Perl server? <jdubois@keane.com>
Re: Where to put cgi-lib.pl <evonzee@tritechnet.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 25 Sep 1998 17:49:16 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: [Fwd: IP Hardware acting as self (from self)]
Message-Id: <360BD52F.6916CDDB@bbnplanet.com>
Bill Jones, FCCJ Webmaster wrote:
> [Posted to comp.sys.sun.admin]
So why post this here?
> Sep 25 12:03:23 astro unix: IP: Hardware address '08:00:20:7d:55:cd'
> trying to be our address 207.203.061.002!
What part about this error message isn't _completely_ obvious? It means
the network admin should go put the smack down on whomever installed a
new machine with your ip. You might want to look at that ip too.
Name: astro.fccj.cc.fl.us
Address: 207.203.61.2
> Anyone have any ideas or other resources to point me to
> so that I may resolve this?
Call your network admin, give them the mac address and have them go find
where they are on the network.
oops, though, looks like you're it.
Florida Community College at Jacksonville (FCCJ6-DOM)
501 W State St
MCCS Rm 237
Jacksonville, FL 32202
US
Domain Name: FCCJ.ORG
Administrative Contact, Technical Contact, Zone Contact:
Jones, Bill (BJ1936) bill@ASTRO.FCCJ.CC.FL.US
904 632-3089 (FAX) 904 632-3007
Billing Contact:
Jones, Bill (BJ1936) bill@ASTRO.FCCJ.CC.FL.US
904 632-3089 (FAX) 904 632-3007
Record last updated on 13-Jan-98.
Record created on 13-Jan-98.
Database last updated on 25-Sep-98 04:10:02 EDT.
Domain servers in listed order:
NNS1.FCCJ.CC.FL.US 207.203.47.18
NS2.CL.BELLSOUTH.NET 205.152.16.8
So, you might want to try something like this...
traceroute to 207.203.61.2 (207.203.61.2), 30 hops max, 40 byte packets
1 198.114.157.2 (198.114.157.2) 1.435 ms 0.794 ms 0.72 ms
2 fa4-1-0.burlma1-ops1.bbnplanet.net (4.2.34.66) 1.432 ms 1.446 ms
1.215 ms
3 h5-0-0.boston1-br1.bbnplanet.net (4.0.3.181) 2.186 ms 2.069 ms
2.035 ms
4 p11-0-0.boston1-br2.bbnplanet.net (4.0.2.250) 2.526 ms 2.081 ms
2.211 ms
5 sr1.bos1.alter.net (4.0.2.74) 2.703 ms 2.491 ms 2.234 ms
6 125.ATM2-0.XR2.BOS1.ALTER.NET (146.188.177.14) 2.198 ms 2.044 ms
1.99 ms
7 190.ATM2-0.TR2.NYC1.ALTER.NET (146.188.179.98) 9.594 ms 6.455 ms
6.925 ms
8 104.ATM7-0.TR2.ATL1.ALTER.NET (146.188.136.61) 26.737 ms 26.776
ms 26.761 ms
9 198.ATM7-0.XR2.ATL1.ALTER.NET (146.188.232.101) 26.404 ms 26.803
ms 26.759 ms
10 194.ATM3-0-0.GW1.JAX1.ALTER.NET (146.188.232.165) 34.684 ms 34.63
ms 34.93 ms
11 bs-jackson-gw.customer.alter.net (157.130.65.226) 36.062 ms 39.191
ms 36.061 ms
12 host-205-152-78-160.jax.bellsouth.net (205.152.64.160) 36.285 ms
36.145 ms 41.873 ms
13 * * *
14 * * *
15 *^C
PING 207.203.61.2 (207.203.61.2): 56 data bytes
64 bytes from 207.203.61.2: icmp_seq=0 ttl=239 time=43 ms
64 bytes from 207.203.61.2: icmp_seq=1 ttl=239 time=43 ms
64 bytes from 207.203.61.2: icmp_seq=2 ttl=239 time=49 ms
64 bytes from 207.203.61.2: icmp_seq=3 ttl=239 time=41 ms
64 bytes from 207.203.61.2: icmp_seq=4 ttl=239 time=39 ms
64 bytes from 207.203.61.2: icmp_seq=5 ttl=239 time=41 ms
64 bytes from 207.203.61.2: icmp_seq=6 ttl=239 time=40 ms
64 bytes from 207.203.61.2: icmp_seq=7 ttl=239 time=55 ms
8 packets transmitted, 8 packets received, 0% packet loss
round-trip (ms) min/avg/max = 39/43/55
So, its pingable and traced at least to bellsouth. So, now you have to
figure out if its someone on your network, or somewhere else. you might
do a man 'arp' and see what that says. Get onto one of the routers, etc.
These are the kinds of things you start with. I am rather amazed that a
tech contact for rather large edu domain couldn't figure this out on
their own.
e.
"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: Fri, 25 Sep 1998 12:53:29 -0500
From: Bobn <BobN@interaccess.com>
Subject: Re: Can't locate loadable object Module?
Message-Id: <360BD899.8E@interaccess.com>
I *think* I saw this when a module (in my case, Data:Dumper) had a
commmand "bootstrap Data::Dumper;" in it and some precompiled thing or
other was missing (I was using a binary distribution) - commenting out
the "bootstrap .." command worked for me. (If I weren't really lazy and
impatient, I probably could have built perl properly to get around
this.)
Hope this does more good than harm.
- Bob N.
Mick wrote:
>
> I'm running (Redhat 5.1) Apache 1.3.1 with mod_perl, and when I try to
> start up httpd, I get
> Cant locate loadable object for module DBI in @INC. .......
> DBI.pm contains the offending line
> use DBI () on line 3.
> Am I missing something, or have I installed wrongly?
>
> Any help is greatly appreciated!
> Mick
------------------------------
Date: 25 Sep 1998 13:02:14 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: cat reese > /dev/null (was Re: Perl & Java - differences and uses)
Message-Id: <sarg1dgw2g9.fsf@camel.fastserv.com>
>>>>> "GR" == George Reese <borg@imaginary.com> writes:
GR> A "decade" is a good approximation of 8 years. And, yes, I was in
GR> college in 1991.
just shows how little you learned. was your college promoted by sally
struthers? did you major in poor polemics? did they have a maximum SAT
score for entry? who printed up your java certificate, yourself?
do you actually realize you are dealing with adults who majored in
computer science, who have more than one partial decade of experience,
who have published articles, books, gotten patents, designed large
systems and one liners, etc., etc.
so where do you come off with your twisted non-logic, unsupported
claims, and telling us what is the right way to do anything in any field
(let alone computers).
it must take a strong character to make hundreds of enemies (who must
all be wrong), and stand up so tall and proud. in twelve angry men
henry, fonda did it. you are no henry fonda!
and read computation by marvin minsky or godel, escher bach. if you did
and actually understood something, we might raise our respect level for
you up from the gutter.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Fri, 25 Sep 1998 13:23:21 -0400
From: John Porter <jdporter@min.net>
Subject: Re: cat reese > /dev/null (was Re: Perl & Java - differences and uses)
Message-Id: <360BD189.C448692E@min.net>
George Reese wrote:
>
> In comp.lang.java.programmer John Klassa <klassa@aur.alcatel.com> wrote:
> : On Tue, 22 Sep 1998 13:47:48 GMT, George Reese <borg@imaginary.com> wrote:
> : > Ahh, yes, let's all be judged by the code we wrote a decade ago in
> : > college.
>
> : You didn't write code a decade ago, in college. You didn't write code a
> : decade ago, period. You didn't write code until at least 1991, according
> : to your web page (excerpted below, without permission). Since you claim to
> : be a stickler for the facts, and for what's been said, I thought this was
> : relevant.
>
> A "decade" is a good approximation of 8 years. And, yes, I was in
> college in 1991.
So you really mean: A "decade" is a good approximation of 7 years.
30%-43% error is not what I'd call a good approximation.
In any case, a "decade" is a very poor approximation of 5 years.
According to your resume, you first worked as a programmer in 1993.
Your first attested programming experience (muds) was in late 1992.
So I take it that by "a decade" you're just rounding 6 up to the
nearest whole number of decades.
--
John "Many Jars" Porter
------------------------------
Date: 25 Sep 1998 17:29:58 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: cat reese > /dev/null (was Re: Perl & Java - differences and uses)
Message-Id: <906744526.793310@thrush.omix.com>
George Reese <borg@imaginary.com> wrote:
: In comp.lang.java.programmer John Klassa <klassa@aur.alcatel.com> wrote:
: : On Tue, 22 Sep 1998 13:47:48 GMT, George Reese <borg@imaginary.com> wrote:
: : > Ahh, yes, let's all be judged by the code we wrote a decade ago in
: : > college.
: : You didn't write code a decade ago, in college. You didn't write code a
: : decade ago, period. You didn't write code until at least 1991, according
: : to your web page
>snip<
: A "decade" is a good approximation of 8 years.
This is why the English language has qualifiers like "nearly".
Please feel free to use as many as you feel you need to express
yourself clearly. You have no right to get upset with anyone
if you are simply to lazy to state yourself clearly, however
if the problem stems from a lack of background in the English
language I'm sure the readers here can recommend a few good
texts that may help.
If you sold something that was marked $8, would you ask the buyer
for $10 because it "is a good approximation of 8"?
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: 25 Sep 1998 17:19:04 GMT
From: jahwan@lilac.engin.umich.edu (Jahwan Kim)
Subject: Re: even/odd numbers
Message-Id: <slrn70nk2h.ocv.jahwan@lilac.engin.umich.edu>
On 20 Sep 1998 21:33:35 GMT, Josh Kortbein <kortbein@iastate.edu> wrote:
[snip]
> in abstract algebra. Yes, the way it works is basic, but the idea
> of something like the modulus operator is largely useless in lots of
> mathematical situations.
[obperl] Read any book on any serious mathematics. Or read Wiles' proof.
Jahwan
------------------------------
Date: 25 Sep 1998 17:43:58 GMT
From: Adam Levin <levinsNOSPAM@westnet.com>
Subject: Help compiling
Message-Id: <6ugkou$102g$1@mycroft.westnet.com>
I recently grabbed perl5.005_01. I'm compiling on a Sun Ultra 1
running Solaris 2.5.1. I'm compiling using gcc-2.8.1 installed from a
package pre-compiled downloaded from www.sunfreeware.com.
I don't have any extra libraries or includes to add -- I want plain
vanilla perl. I run Configure, leaving everything as default. I
decided to build with threads. During the make, I get:
gcc -B/usr/ccs/bin/ -o miniperl miniperlmain.o libperl.a -lsocket
-lnsl -ldl -lm -lc -lcrypt
Undefined first referenced
symbol in file
pthread_getspecific libperl.a(perl.o)
pthread_self libperl.a(perl.o)
pthread_detach libperl.a(perl.o)
pthread_key_create libperl.a(perl.o)
pthread_setspecific libperl.a(perl.o)
pthread_join libperl.a(perl.o)
ld: fatal: Symbol referencing errors. No output written to miniperl
*** Error code 1
make: Fatal error: Command failed for target `miniperl'
I've tried without threads and I get the same thing at the same point
(but different symbols, naturally). I'm not compiling libperl.so.
I'm not sure what to do next -- I'm used to installing on SGIs (no
gcc) and linux systems, but I've never encountered this problem.
Any help would be greatly appreciated.
-Adam
(note the anti-spam bit in the email address)
--
Rutherford, NJ USA Free speech online!_/ The man gave a shrug which
http://westnet.com/~levins/ _______/ indicated that, although the
<*> __________________________/ world did indeed have many problems,
-O / this was one of them that was not his.
------------------------------
Date: Fri, 25 Sep 1998 17:05:15 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: help with removing leading zeros with reg-exp
Message-Id: <f3QO1.524$7Q6.4651142@news2.voicenet.com>
Mark Stackhouse <stackhou@execpc.com> wrote:
>I'm trying to remove leading zeros in the first six elements of file
>lines. The closest code I can come up with is:
>
> -snip-
>
> if ($line_element[$k] =~ /^0/) #match leading zeros
> {
> $line_element[$k] =~ tr/1-9//cd; #remove zeros
You're forgetting the 0! You don't need the /c modifier.
>I want "000" to be "0"
> "001" to be "1"
> "002" to be "2"
> etc.
> "010" to be "10" and so on all the way up to "71"
Since you want to retain a zero if the string in question is only
zeroes, and remove all other zeroes, tr is a bad choice. You could use
the /s modier to tr to squash multiple zeroes down to one, but you'd
still be left with '00001' becoming '01'. You need more power than tr
can offer. Try this instead:
#!/usr/local/bin/perl
$, = "\n";
@strs = qw/ 000000 001 000002 00 3 0 0000000 /;
print "Strings before:\n", @strs;
for (@strs) {
s/^0{1,5}(\d.*)/$1/;
}
print "\n\nStrings after:\n", @strs, "\n";
__END__
The last element in the array @strs is an exception. It has 7 zeroes.
Since you only want to check the first 6 bytes of the string, It should
leave 2 zeroes.
--
Matt Knecht - <hex@voicenet.com>
------------------------------
Date: Fri, 25 Sep 1998 09:59:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: help with removing leading zeros with reg-exp
Message-Id: <MPG.10756be7549791319897bc@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <6ugf6e$7gg@newsops.execpc.com> on Fri, 25 Sep 1998 11:02:14 -
0500, Mark Stackhouse <stackhou@execpc.com> says...
...
> for ($k=0; $k<=5; $k++) #check the first 6 elements
> {
> if ($line_element[$k] =~ /^0/) #match leading zeros
> {
> $line_element[$k] =~ tr/1-9//cd; #remove zeros
> }
> }
Replace the guts of the loop by:
$line_element[$k] =~ s/^0+//;
A more Perlish way to write the whole thing might be:
foreach (@line_element[0 .. 5]) { s/^0+// }
Another way to do it, if you're concerned about a datum of all zeros
disappearing, is either:
foreach (@line_element[0 .. 5]) { s/^0+(?=\d)// }
or
foreach (@line_element[0 .. 5]) { $_ += 0 }
The latter benchmarks faster, but doesn't use a regex (as your subject
demands :-).
#!/usr/local/bin/perl -w
use Benchmark;
my @a = qw( 000 001 002 003 004 005 006 007 );
print "@a\n";
timethese (1 << (shift || 0), {
Regex => sub { my @b = @a; foreach (@b[0 .. 5]) { s/^0+// } },
Save_0 => sub { my @b = @a; foreach (@b[0 .. 5]) { s/^0+(?=\d)// },
Sum => sub { my @b = @a; foreach (@b[0 .. 5]) { $_ += 0 } },
} );
Benchmark: timing 16384 iterations of Regex, Save_0, Sum...
Regex: 15 secs ( 3.45 usr 0.02 sys = 3.47 cpu)
Save_0: 21 secs ( 3.61 usr 0.02 sys = 3.63 cpu)
Sum: 15 secs ( 3.09 usr 0.02 sys = 3.11 cpu)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 25 Sep 1998 13:07:47 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: help with removing leading zeros with reg-exp
Message-Id: <alecler-2509981307470001@dialup-527.hip.cam.org>
In article <6ugf6e$7gg@newsops.execpc.com>, Mark Stackhouse
<stackhou@execpc.com> wrote:
> Could someone please clear up my misunderstanding of "tr"?
>
> I'm trying to remove leading zeros in the first six elements of file
> lines. The closest code I can come up with is:
>
> for ($k=0; $k<=5; $k++) #check the first 6 elements
> {
> if ($line_element[$k] =~ /^0/) #match leading zeros
> {
> $line_element[$k] =~ tr/1-9//cd; #remove zeros
> }
> }
Did you consider using the substitution operator instead?
$line_element[$k] =~ s/^0+//; # replace 1 or more zeros at the beginning
Simple enough...
> With the above code, I delete the "0" and "10" becomes "1" etc.
Naturally, you're replacing all zeros with nothing.
HTH,
Andre
------------------------------
Date: 25 Sep 1998 17:57:51 GMT
From: mike@mike.stok.co.uk (Mike Stok)
Subject: Re: help with removing leading zeros with reg-exp
Message-Id: <6ugliv$feo@news-central.tiac.net>
In article <6ugf6e$7gg@newsops.execpc.com>,
Mark Stackhouse <stackhou@execpc.com> wrote:
>Could someone please clear up my misunderstanding of "tr"?
>
>I'm trying to remove leading zeros in the first six elements of file
>lines. The closest code I can come up with is:
>
>for ($k=0; $k<=5; $k++) #check the first 6 elements
> {
> if ($line_element[$k] =~ /^0/) #match leading zeros
> {
> $line_element[$k] =~ tr/1-9//cd; #remove zeros
> }
> }
>
>I want "000" to be "0"
> "001" to be "1"
> "002" to be "2"
> etc.
> "010" to be "10" and so on all the way up to "71"
Of course, you don't have to use regexes or tr at all, if the data is
known to have decimal numbers then you can just say
foreach $k (0 .. 5) {
$line_element[$k] += 0;
}
and next time you use it as a string it'll not have leading zeros.
This may be acceptable if your data doesn't have non-digit strings, these
will get turned into 0.
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
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Fri, 25 Sep 1998 13:03:01 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <360BCCC5.D5192CE@min.net>
Zenin wrote:
>
> I would like to challenge
> that the current OO support set of Perl rivals most other
> common OO languages such as Python and Java.
Right; because
( ( Better-OO-Support(X) => Better-Language(X) )
=> not-Better-Language(Perl) ) )
=> not-Better-OO-Support(Perl)
That last is the key predicate.
--
John "Many Jars" Porter
------------------------------
Date: 25 Sep 1998 07:02:23 -1000
From: Joseph Allen Dane <jdane@hawaii.edu>
Subject: Re: Perl & Java - differences and uses
Message-Id: <297lysjfc0.fsf@honlab.nmfs.hawaii.edu>
Zenin <zenin@bawdycaste.org> writes:
> Joseph Allen Dane <jdane@hawaii.edu> wrote:
> : Zenin <zenin@bawdycaste.org> writes:
> >snip<
> : Your point is taken. In order to make closures work, objects to be
> : closed over need to have indefinite extent. They can't be allocated
> : on a stack. So I was mistaken above that Java could close over
> : primitive types, which can only be allocated on the stack. But Java
> : objects can be closed over in the way you describe above.
> >code sniped<
> : Is this not a closure?
>
> You're right, it fits the definition of a closure. I must concede
> this point. Well done.
>
> Now, as far as readability, maintainability, et al are
> concerned (ie, how we originally got to this issue) that the
> verbose and (IMHO) confusing code need to do handle such a
> construct is highly counter productive, both for the programmer
> and the program, as it requires the maintainer to search through
> possibly thousands of lines of code to find where this inner class
> was defined to know what magic it might be trying to do, among other
> problems. This is quite similar to the problems with goto.
Agreed. I never said it was pretty.
As for how to "translate" the code you posted into an OO solution, I
really don't know. I would guess that one might consider a mapping
between lexical closures and objects with instance variables. It
comes down to different ways of looking at the problem, and to say
that one way is somehow categorically "better" than another seems
pretty meaningless to me. Which, I think, was at least part of your
original point in this eternal thread.
--
joe
------------------------------
Date: Fri, 25 Sep 1998 13:37:18 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <360BD4CE.FCECCB35@min.net>
Zenin wrote:
>
> George Reese <borg@imaginary.com> wrote:
> : In comp.lang.java.programmer Zenin <zenin@bawdycaste.org> wrote:
> : : George Reese <borg@imaginary.com> wrote:
> : : : Inner classes should be avoided like the plague for the most part.
> : :
> : : IYO, of course.
> : :
> : : Please be carful not to phrase your opinions as declarations,
> : : at least without sighting proof.
> :
> : You are such a prick. I cite proof.
>
> I never said you didn't.
>
> : I stated that they open up your
> : private fields to external classes that would not otherwise have such
> : access. What about that is not proof?
>
> Nothing. It's perfect proof. I never said it wasn't.
I think you both need to revisit your dictionaries.
George said "should be avoided". This is clearly a matter of opinion,
or advisement. It is not subject to proof.
Now, laying aside the term "proof", and rather asking "WHY should foobar
be avoided", then George offered one reason. However, it asks as many
questions as it answers, so the skeptical discutant is left unsatisfied.
Zenin, for whatever reasons, is -- or is appearing to be -- satisfied.
> Your comments, true or false, with or without proof are still your
> opinions as well. I only asked you not to "phrase your opinions as
> declarations, at least without citing proof"...
This, IMHO, strikes at the heart of the matter.
George is entirely too prone to stating his opinions as though they
were fact. I suspect that he might really be unable in his mind to
distinguish -- without great effort, anyway -- between his opinion
and objective fact.
--
John "Many Jars" Porter
------------------------------
Date: Fri, 25 Sep 1998 09:24:06 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl as http User Agent?!
Message-Id: <fl_aggie-2509980924070001@aggie.coaps.fsu.edu>
In article <MPG.10754662c7d63a3498968c@netnews.worldnet.att.net>,
sorentin@m6.sprynet.com (Soren Andersen) wrote:
+ Can anyone offer a knowledgeable explanation or even a sound conjecture
+ about who my mystery visitor was? A search bot or spider implemented in
+ Perl?
Possibly, see the other responses about LWP. Do note that is the default
identity, but that it is user configurable and can be anything. If it
where a spider, tho, you'd probably have many other hits from it.
+ Thanks - I am a new webmaster and need to learn about what's going on,
+ clearly.
The user agent information isn't particularly useful, tho some people act
like it is. Ironically, your example is from IE 4, which pretends to be
Mozilla...
James
------------------------------
Date: Fri, 25 Sep 1998 17:54:37 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Perl as http User Agent?!
Message-Id: <360BD66F.A3334321@bbnplanet.com>
Sean McAfee wrote:
> Second, as I was getting tired of waiting for the Sci-Fi Channel's
> graphics-intensive pages to load over my slow modem link just so I could
> see whether MST3K is a rerun this week, I wrote a script which directly
MST3K is wonderful. Even the reruns. :)
e.
"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: 25 Sep 1998 17:54:13 GMT
From: chrija@aol.com (ChriJa)
Subject: Programmierer gesucht!
Message-Id: <19980925135413.15635.00001767@ng43.aol.com>
Wir suchen Programmierer f|r die Weiterentwicklung von Acses, unserer
Buchpreis-Suchmaschine auf http://www.acses.com !
Anforderungsprofil:
- Fundierte Kenntnisse und Arbeitserfahrung in einer oder mehreren der
folgenden Sprachen: C, C++, Java, Perl.
- Fundierte Kenntnisse und Arbeitserfahrung in einem oder mehrereren der
folgenden Bereiche: Suchmaschinenprogrammierung, Agententechnologien,
Datenbankprogrammierung, allgemeine Internet-Programmierung.
- Ein Abschlu_ oder ein Studium in einem verwandten Bereich kann vorteilhaft
sein, ist aber kein Mu_. Was zdhlt, sind die individuellen Kenntnisse und
Fdhigkeiten.
- Engagement, Motivation, Begeisterung f|r das Internet, selbstdndiges Arbeiten
Geboten werden:
- die Arbeit an einem innovativen und extrem vielversprechenden Projekt
- jede Menge Freiheiten und Spa_ bei der Arbeit in einem jungen,
unkonventionellen, effektiv arbeitenden und erfolgreichen Unternehmen
- gute Bezahlung
Interessiert? Dann kontaktieren Sie mich uns unter cjanz@acses.com, um alles
weitere zu besprechen.
Christoph Janz
Muenchhoff & Janz GmbH
Badstrasse 33
71642 Ludwigsburg
Telefon: (0 71 41) 25 00 43
Fax: (0 71 41) 25 00 71
cjanz@acses.com
http://www.acses.com
------------------------------
Date: 25 Sep 1998 13:35:57 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Q: Picking an element from a hash (not knowing which!) [Zorn's lemma?]
Message-Id: <6ugk9t$9g2$1@monet.op.net>
In article <6ugbjv$4ao$1@nnrp1.dejanews.com>, <droby@copyright.com> wrote:
>In article <6udupf$2c5$1@monet.op.net>,
> mjd@op.net (Mark-Jason Dominus) wrote:
>> In article <6udj6m$6qj$1@nnrp1.dejanews.com>, <droby@copyright.com> wrote:
>> >Actually, the description she gave was the Axiom of Choice.
>>
>> Actually, it wasn't. AC is not about selecting an element from a set.
> How so? Seems to me that's why it's called what it is.
Because the original article was only discussing selecting one element
from one set. You don't need AC to tell you that a nonempty set
contains an element. And you certainly don't need it to select an
element from a finite set. Nobody ever disputed that you can select
elements from finite sets. They're finite. You make a list of the
elements and take the first one. Which is just what we did do.
> [Statement of the Axiom of Choice omitted]
>This sounds to me like saying you can select one element out of each of a set
>of sets.
>Perhaps we should ask in sci.math?
If you like, but the answer is already in your own article.
Just compare the two sentences:
Me: ``AC is not about selecting an element from a set.''
You: ``[AC says] you can select one element out of each of a set of sets.''
See? We are in complete agreement.
------------------------------
Date: Fri, 25 Sep 1998 12:51:27 -0500
From: Tom Turton <tturton@cowboys.anet-dfw.com>
Subject: Redirection Question
Message-Id: <360BD81E.C2544E39@cowboys.anet-dfw.com>
This is a multi-part message in MIME format.
--------------0F45B99B5D03A94C737FB223
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I posted a question earlier on this to which Randall provided some
helpful responses; however I am still having a bit of difficulty on what
portion. Below is a copy of my test code and output from running in
interactively, and as a cronjob with output redirection pipes.
Perl is no doubt doing what it is supposed to do (as opposed to what I
*want* it to do :-), so IS there a way to make it do what I want to
do? Summing up what I am trying to do:
-- redirect default STDERR via 2> into an abnormal.log file
-- for large portion of code, override filehandle for STDERR to
send it out to error.log
-- for a small, local code block, let STDERR go back to STDERR
default (i.e. abnormal.log from 2> pipe)
-- outside of local code block, return to sending STDERR to
error.log
It looks like open (STDERR, ">-"); and
open (STDERR, "&STDOUT") do the identical thing.
Thanks for your help.
---Tom Turton
--------------0F45B99B5D03A94C737FB223
Content-Type: text/plain; charset=us-ascii; name="perl_stderr.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="perl_stderr.txt"
#!/usr/local/gnu/bin/perl -w
use diagnostics;
# crontab output pipes: > normal.log
# 2> abnormal.log
select STDERR;
$| = 1;
select STDOUT;
$| = 1;
####################
# Defaults #
####################
print STDERR "0) This should go to screen if interactive; abnormal.log if cronjob.\n";
#######################################
# Redirect STDERR to error.log #
#######################################
open STDERR, ">/home/tturton/PERL/error.log";
print STDERR "1) This should go to error.log if interactive OR cronjob.\n";
##############################################
# Redirect 'local' STDERR to Default STDERR #
##############################################
{
local *STDERR;
open (STDERR, ">-"); # ports it to STDOUT, instead of default STDERR
select STDERR;
$| = 1;
print STDERR "2) This should go to screen if interactive; abnormal if cronjob.\n";
}
#####################################
# Resume using STDERR (error.log) #
#####################################
print STDERR "3) This should be back in error.log if interactive OR cronjob.\n";
####################################
# Redirect STDERR to STDOUT #
####################################
open STDERR, ">&STDOUT";
print STDERR "4) This should go out to screen if interactive; normal.log if cronjob\n";
========================================================================================
#########################################################
# Result of running cronjob: #
#########################################################
# error.log:
1) This should go to error.log if interactive OR cronjob. OK
3) This should be back in error.log if interactive OR cronjob. OK
# normal.log:
2) This should go to screen if interactive; abnormal if cronjob. X
4) This should go out to screen if interactive; normal.log if cronjob OK
# abnormal.log:
0) This should go to screen if interactive; abnormal.log if cronjob. OK
#########################################################
# Result of running interactively: #
#########################################################
# screen:
0) This should go to screen if interactive; abnormal.log if cronjob. OK
2) This should go to screen if interactive; abnormal if cronjob. OK
4) This should go out to screen if interactive; normal.log if cronjob OK
# error.log:
1) This should go to error.log if interactive OR cronjob. OK
3) This should be back in error.log if interactive OR cronjob. OK
--------------0F45B99B5D03A94C737FB223--
------------------------------
Date: 25 Sep 1998 13:38:14 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Regular Expression Operator Precedence
Message-Id: <6ugke6$9gn$1@monet.op.net>
In article <yl7lys2n87.fsf@windlord.stanford.edu>,
Russ Allbery <rra@stanford.edu> wrote:
>Actually, I believe that corresponds to the table:
Gosh, I wonder what I could have been thinking? Thanks!
------------------------------
Date: Fri, 25 Sep 1998 10:20:15 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: regular expression
Message-Id: <MPG.107570a958e464629897bd@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <360BCECD.F9609664@nmsu.edu> on Fri, 25 Sep 1998 10:11:41 -
0700, Tao Wei <twei@nmsu.edu> says...
> Hi folks, I am new to perl. I couldn't figure out why following two
> regexes not working as I expected.
> 1)
> $string = "<B>some text here<\B> more text";
> $string =~ s/<B>(.*)<\B>/$1/;
> $string turned out to be "<B>some text here<\B> more text" instead of
> "some text here".
You have confused '/' with '\'. Try this:
$string = "<B>some text here</B> more text";
$string =~ s%<B>(.*?)</B>.*%$1%;
I have changed the regex delimiter because of that included '/', and made
the match non-greedy, lest you eat up other things in the same string. I
also added a '.*' to eliminate everything after the '</B>', because that
is what you said you wanted ("some text here").
> 2)
> $number = 123.23465;
> $number =~ /(\.\d\d[1-9]?)\d+/$1/;
> $number turned out to be 123.234. I don't understand why it is not
> necessary to match digits before point using
> s/(\d*(\.\d\d[1-9]?))\d+/$1/)
Anything in the operand string before and after the portion you have
matched with the regex is not changed by the substitution.
BTW, you left out the 's' in your regex match, so what you posted
wouldn't compile in any case.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 25 Sep 1998 10:16:23 -0500
From: John Warner <support@acuity.com>
To: Geert Roovers <Geert.Roovers@ericsson.com>
Subject: Re: Security problem
Message-Id: <360BB3C7.74F108EF@acuity.com>
--------------9C53F37F226669EAC57220F6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Essentially what you are doing is an HTTP GET request which will be difficult to encrypt.
We had/have a similar problem with our chat server software. We solved it by having our
server apply a regex filter and disabling certain portions of user profiles. The only
solution I can see to your problem is to validate the user input before posting it to your
database. This can be tricky because there could be any number of levels of redirection
to scan before getting to malicious code.
As for preventing someone from figuring out your protocol, the only way to do that is
through an SSL connection between the user and your Perl script. Unfortunately, I have no
idea how to implement SSL in Perl. While a user could figure out the protocol by viewing
the document source and making some educated guesses, SSL would prevent connections to
your server from working.
Geert Roovers wrote:
> Hello.
>
> When displaying a plain text database record, I want to display possible
> urls as a link in a HTML page. What I do now, is read the fields of a
> record. If it starts with "http://", I replace the field contents with
>
> <a href="fieldcontents">fieldcontents</a>
>
> using a perlscript. This works very nicely.
>
> Problem: The users can fill in new fields (thus: new urls) by
> themselves. I think this might deliver a security risk. I'm thinking of
> someone entering an url like
>
> http://www.ourhost.com/cgi-bin/mail.pl?sender=us&adressee=someoneelse&attachment=virus
>
> I realize that the person has to know our mailscript, and how it works
> and everything, but still, it might be possible that he found that out
> somewhere else on one of our homepages, and does a thing like this.
>
> Is there a way of checking if an url is secure enough to change it into
> an link? And how do I do this in perl? Or where can i find how to do
> this?
>
> ~Geert
>
> If I'm not clear enough, ask me what info you need further.
>
> Geert
--------------9C53F37F226669EAC57220F6
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Essentially what you are doing is an HTTP GET request which will be difficult
to encrypt. We had/have a similar problem with our chat server software.
We solved it by having our server apply a regex filter and disabling certain
portions of user profiles. The only solution I can see to your problem
is to validate the user input before posting it to your database.
This can be tricky because there could be any number of levels of redirection
to scan before getting to malicious code.
<P>As for preventing someone from figuring out your protocol, the only
way to do that is through an SSL connection between the user and your Perl
script. Unfortunately, I have no idea how to implement SSL in Perl.
While a user could figure out the protocol by viewing the document source
and making some educated guesses, SSL would prevent connections to your
server from working.
<P>Geert Roovers wrote:
<BLOCKQUOTE TYPE=CITE>Hello.
<P>When displaying a plain text database record, I want to display possible
<BR>urls as a link in a HTML page. What I do now, is read the fields of
a
<BR>record. If it starts with "<A HREF="http://">http://</A>", I replace
the field contents with
<P><a href="fieldcontents">fieldcontents</a>
<P>using a perlscript. This works very nicely.
<P>Problem: The users can fill in new fields (thus: new urls) by
<BR>themselves. I think this might deliver a security risk. I'm thinking
of
<BR>someone entering an url like
<P><A HREF="http://www.ourhost.com/cgi-bin/mail.pl?sender=us&adressee=someoneelse&attachment=virus">http://www.ourhost.com/cgi-bin/mail.pl?sender=us&adressee=someoneelse&attachment=virus</A>
<P>I realize that the person has to know our mailscript, and how it works
<BR>and everything, but still, it might be possible that he found that
out
<BR>somewhere else on one of our homepages, and does a thing like this.
<P>Is there a way of checking if an url is secure enough to change it into
<BR>an link? And how do I do this in perl? Or where can i find how to do
<BR>this?
<P>~Geert
<P>If I'm not clear enough, ask me what info you need further.
<P>Geert</BLOCKQUOTE>
</HTML>
--------------9C53F37F226669EAC57220F6--
------------------------------
Date: 25 Sep 1998 17:13:47 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: two dimensional hashes
Message-Id: <906743555.671078@thrush.omix.com>
[posted & mailed]
Kjetil Skotheim <kjetil.skotheim@usit.uio.no> wrote:
>snip<
: $h{'mutant1','enzyme1'} = 'data';
: $h{'mutant2','enzyme1'} = 'data';
: $h{'mutant3','enzyme1'} = 'data';
: $h{'mutant1','enzyme2'} = 'data';
That should actually be:
$h{mutant1}{enzyme1} = 'data';
$h{mutant2}{enzyme1} = 'data';
$h{mutant3}{enzyme1} = 'data';
$h{mutant1}{enzyme2} = 'data';
: or
: %h = (
: "mutant1$;enzyme1" => 'data',
: "mutant2$;enzyme1" => 'data',
: .
: .
: .
: );
Hmm...you're thinking perl4 here with a bit of perl5
notation. Try this:
%h = (
mutant1 => {
enzyme1 => 'data',
enzyme2 => 'data',
enzyme3 => 'data',
},
mutant2 => {
enzyme1 => 'data',
enzyme2 => 'data',
enzyme3 => 'data',
},
.
.
.
);
: for(keys %h){
: my($mutant,$enzyme)=split($;,$_);
: print "$mutant $enzyme" if $h{$_} =~ /.../
: }
while (my ($mutant, $enzymes) = each %h) {
foreach my $enz (keys %$enzymes) {
if ($enzymes->{$enz} =~ /match something/) {
print "$mutant $enz\n";
}
}
}
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Fri, 25 Sep 1998 13:22:43 -0400
From: Joseph DuBois <jdubois@keane.com>
Subject: Re: Unix Perl server?
Message-Id: <360BD163.61D67DB1@keane.com>
Peter Moore wrote:
> Joseph,
> Do you mean on a web server? If so, there is a module for the Apache
> www server which does this.
> regards
> peter
>
No, There was a deamon that ran as a background process that acted as
the perl interpreter. That way it was always running and you did not have
the startup time of starting perl each time a process was spawned. The
need for this will probably go away when the compiler is fully functional
though.
This was a commercial program, but I can't remeber the company.
> Joseph DuBois wrote:
>
> > Well met,
> >
> > Awhile back I remember seeing a comercial program that acted as
> > the perl interpreter, but stayed running as a process. Thus it cut
> > out the startup time of the perl interpreter.
> >
> > The problem is I do not rember the company, or product name. I
> > was wondering if anyone knows the name, and even better has used
> > or tested it.
> >
> > Thanks
> >
> > --
> > -------------------------------------------------------
> > Joseph DuBois
> > mailto:jdubois@keane.com (Work) http://www.keane.com/
--
-------------------------------------------------------
Joseph DuBois (Internet/Intranet Specialist)
mailto:jdubois@keane.com (Work) http://www.keane.com/
------------------------------
Date: Fri, 25 Sep 1998 12:13:23 -0500
From: Eric Von Zee <evonzee@tritechnet.com>
Subject: Re: Where to put cgi-lib.pl
Message-Id: <360BCF33.787AB9EE@tritechnet.com>
In addition to previous message: Perl acts on data in a BEGIN block at compile-time,
not run-time.
For example: (taken straight from the manpages)
use Module ();
is exactly equivalent to
BEGIN { require Module }
Cheers,
-Eric
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3824
**************************************