[9898] in Perl-Users-Digest
Perl-Users Digest, Issue: 3492 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 20 13:07:43 1998
Date: Thu, 20 Aug 98 10:01:27 -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 Thu, 20 Aug 1998 Volume: 8 Number: 3492
Today's topics:
IIS 4.0 and PERL 5.004 <avelar@nortel.com>
Re: IIS 4.0 and PERL 5.004 (Steve Linberg)
Nested regexp deepak@npac.syr.edu
Re: Nested regexp <nguyend7@msu.edu>
Re: Netscape response to Perl using Front Page extensio (Abigail)
perl configuration database (Greg Bacon)
Re: Perl Lex ? Perl Yacc ? (Damian Conway)
Re: Perl Lex ? Perl Yacc ? <jdf@pobox.com>
Re: Reading from files (I.J. Garlick)
Stumped! Need help! <davemee@tvlistings.co.uk>
Re: Stumped! Need help! <jdf@pobox.com>
Re: such a thing as a "perl user"? <murrayb@vansel.alcatel.com>
Re: such a thing as a "perl user"? <rkoehler@osmre.gov>
Re: Trouble with Net-SSL (Mads Toftum)
undef $/ in one-liner? <matt.edwards@thinkinc.com>
Re: undef $/ in one-liner? <dgris@rand.dimensional.com>
Re: undef $/ in one-liner? <jdf@pobox.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 20 Aug 1998 10:34:16 -0400
From: "Mike S. Avelar" <avelar@nortel.com>
Subject: IIS 4.0 and PERL 5.004
Message-Id: <6rhbtr$l4f@bcarh8ab.bnr.ca>
I've installed PERL 5.004 on my NT 4.0 Server running IIS 4.0. When a
perl script is called you can see the "perl.exe" in the task manager but the
script is not executed.
The script is not listed as denied in the log files. All the settings
are correct (including the Application Settings in IIS 4.0) but the script
will not execute... not even localy. It will however execute a perl script
from the command prompt.
Any ideas?
------------------------------
Date: Thu, 20 Aug 1998 12:43:40 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: IIS 4.0 and PERL 5.004
Message-Id: <linberg-2008981243400001@projdirc.literacy.upenn.edu>
In article <6rhbtr$l4f@bcarh8ab.bnr.ca>, "Mike S. Avelar"
<avelar@nortel.com> wrote:
> I've installed PERL 5.004 on my NT 4.0 Server running IIS 4.0. When a
> perl script is called you can see the "perl.exe" in the task manager but the
> script is not executed.
[snip]
>It will however execute a perl script
> from the command prompt.
> Any ideas?
Yep: it's your server configuration. Head down the hall to
microsoft.public.inetserver.iis and ask them!
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Thu, 20 Aug 1998 16:17:12 GMT
From: deepak@npac.syr.edu
Subject: Nested regexp
Message-Id: <6rhi68$ik0$1@nnrp1.dejanews.com>
Hello all, Here is my substitution line $fulltag =~
s/$targeturl/$changedrel/; where $targeturl = c++.html (a link on a html page
to a file named c++.html) $changedrel = cplucplu.html (The new name of the
c++.html file) On script execution I get the following error: /c++.html/:
nested *?+ in regexp at cdrommap/copytopc.pl line 855, <I> chunk 23
Is there anyway I can "protect" the targeturl variable so that it ignores the
+ characters in the string?
Any help would be appreciated,
Deepak Ramanathan ‰
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 20 Aug 1998 16:45:36 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: Nested regexp
Message-Id: <6rhjrg$cjp$1@msunews.cl.msu.edu>
deepak@npac.syr.edu wrote:
: Hello all, Here is my substitution line $fulltag =~
: s/$targeturl/$changedrel/; where $targeturl = c++.html (a link on a html page
: to a file named c++.html) $changedrel = cplucplu.html (The new name of the
: c++.html file) On script execution I get the following error: /c++.html/:
: nested *?+ in regexp at cdrommap/copytopc.pl line 855, <I> chunk 23
: Is there anyway I can "protect" the targeturl variable so that it ignores the
: + characters in the string?
: Any help would be appreciated,
try reading the perl man page on regexp. 'man perlre'
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: 20 Aug 1998 16:31:39 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Netscape response to Perl using Front Page extensions
Message-Id: <6rhj1b$mll$6@client3.news.psi.net>
Fish (fish@civl.port.ac.uk) wrote on MDCCCXII September MCMXCIII in
<URL: news:6r9e8r$f7626@tech.port.ac.uk>:
++
++ Submitting a form to a Perl script on an NT machine running Front Page
++ extensions and (I think) IIS 4.0 results in the browser asking the client if
++ he wants to save the results to file, popping up a Windows Save dialog box,
++ rather than printing the form results to the browser direct. This doesn't
++ happen using IE3 or IE4, but seems to happen with Netscape 3.01 or
++ Communicator. Any ideas?
That doesn't smell like a perl problem to me. Perhaps you need Netscape
techsupport, or Microsofts.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: 20 Aug 1998 16:07:17 GMT
From: gbacon@pluto.cs.uah.edu (Greg Bacon)
Subject: perl configuration database
Message-Id: <6rhhjl$l8t$3@info.uah.edu>
I've written a program to grab information from the perlbug -ok
reports from p5p (which contain part of the output from perl -V).
This may aid people who may be having trouble configuring perl on
their respective platforms. It's also cool to see how many different
platforms perl runs on.
Check it out at <URL:http://www.itsc.uah.edu/perl/query> or grab the
source at <URL:http://www.cs.uah.edu/~gbacon/perl/configdb.tar.gz>.
All comments and suggestions welcome!
Greg
--
Now let us retract the foreskin of misconception and apply the wire brush of
enlightenment.
-- Geoff Miller
------------------------------
Date: 20 Aug 1998 15:42:40 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Perl Lex ? Perl Yacc ?
Message-Id: <6rhg5g$v9m$1@towncrier.cc.monash.edu.au>
"Uwe Honekamp" <uwe.honekamp@etas.de> writes:
>Tk Soh <r28629@email.sps.mot.com> wrote =
><35DAD7E4.5179D49A@email.sps.mot.com>...
>> I have used both modules for some of my work. Both modules
>> seemed to run pretty slow, even with relatively simple Lex
>> specification or Yacc grammer. Perhaps it's due to my
>> less-optimised rule and spec design. May be you can tell me more.
>Yes, my experience is basically the same.
>However, I don't know other modules for this purpose and I'm therefore
>more or less happy with them although they're not the fastest.
>Especially Parse::RecDescent is sometimes a bit hard to work with but
>after a while you get a feeling for the traps ...
As RecDescent's proud father, I'd really like to know what you perceive
to be it's "traps", and why you've found it hard to work with (I'd
naturally like it to be trap-free and friendly instead :-)
I often find that people with a Yacc background build RecDescent
grammars which are more heavily recursive than necessary (and so
incur a performance hit since each subrule requires a Perl sub
call) For example, many people will write this:
list: elem list
| elem
instead of:
list: elem(s)
which may be orders of magnitude faster for long lists!
That said, RecDescent *does* has some serious performance difficulties
in specific cases. I *am* working on these in my very limited spare time.
Damian
PS: You may also want to check out the recently released Parse::Yapp by
Francois Desarmenien, which is as close to a native Perl lex/yacc
as you're ever likely to want.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
name: Damian Conway addr: School of Computer Science
email: damian@csse.monash.edu.au and Software Engineering
web: http://www.cs.monash.edu.au/~damian Monash University
fax: +61-3-9905-5146 Clayton 3168, AUSTRALIA
------------------------------
Date: 20 Aug 1998 12:12:13 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Perl Lex ? Perl Yacc ?
Message-Id: <zpcza87m.fsf@mailhost.panix.com>
damian@cs.monash.edu.au (Damian Conway) writes:
> As RecDescent's proud father, I'd really like to know what you perceive
> to be it's "traps", and why you've found it hard to work with (I'd
> naturally like it to be trap-free and friendly instead :-)
I have used and enjoyed your module, but have found that it's
impossible to use with Devel::DProf; it seems to screw up Perl's sense
of function entry/exit.
Followups set.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Thu, 20 Aug 1998 13:59:19 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: Reading from files
Message-Id: <Exzquv.LAr@csc.liv.ac.uk>
In article <35DA8CE0.CBFD4514@prism.gatech.edu>,
Alejandro Lay <gt2214a@prism.gatech.edu> writes:
> A simple solution might be:
> Putting a comment line between the sections of your file and then
> reading the sections into diferrent arrays ie:
>
I am no expert but the code here looked awful.
Filename.txt ---
section1:data
more data
###
section2:data
more data
###
my (%data,$key,$val);
open (FH, "Filename.txt") || die "Can't open Filename.txt: $!";
$/ = "###\n";
while (<FH>) {
$_ =~ s/###\n//s;
($key,$val) = split ':', $_, 2;
$data{$key} = $val;
}
close FH; # should have a die/error report here as well
Surely the above is better? That way you get your data in a hash keyed on
whatever you call each section, accessing that data is then a case of:
print "$data{section1}\n";
TBH if you really must persue this way of doing things try looking into
using a TIEHASH (there are modules out there that will do all of the file
management for you, and return the key and or values, can't recommend one
as i tend to write my own).
>
>> I'm in my very early stages of PERL and have come across a little
>> stump. I'm writing to a file on the internet that stores some info
>> about a product. I want to store all of the product info in it's own
>> specific file but need to know how to tell the computer that each
>> section in the file is a little different and how to pull data from each
>> section within the file. Somehow put labels or something in the file.
>> The things I've tried so far haven't worked. Any help would be great.
>> Thanks a lot!
--
--
Ian J. Garlick
ijg@csc.liv.ac.uk
The intelligence of any discussion diminishes with the square of the
number of participants.
-- Adam Walinsky
------------------------------
Date: Thu, 20 Aug 1998 16:51:19 +0000
From: Dave Mee <davemee@tvlistings.co.uk>
Subject: Stumped! Need help!
Message-Id: <35DC5407.53058C63@tvlistings.co.uk>
How y'doing? Good to hear.
I was wondering if anyone had an elegant solution to >this< problem.
I have hundreds of files open, the filehandles for them are generated
dynamically as I need them. Opening and closing is all handled by
searching through other arrays and constructing filehandles it *knows*
will be open.
What I need to do is read one line from a file, with only a string
pointing to the filehandle.
I *don't* want to have to read the whole file into an array all at once.
I have to skip between files in a random order, so I want the system to
keep track of the position for me automaticcly.
Excuse the crassness of my code, but the mess below is *what* I am
trying to achieve, I hope it's obvious why it doesn't work:
$progs[$item]=<{$fromfile}>;
In a fit of desperation I thought the {} might help but evidently not.
Any ideas, pointers, tips?
(been through Camel, Llama, FAQ, and Dejanews without any leads).
Please help. There's a pint in it for you :)
Cheers, Dave
------------------------------
Date: 20 Aug 1998 12:20:04 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: davemee@tvlistings.co.uk
Subject: Re: Stumped! Need help!
Message-Id: <u337a7uj.fsf@mailhost.panix.com>
Dave Mee <davemee@tvlistings.co.uk> writes:
> $progs[$item]=<{$fromfile}>;
>
> In a fit of desperation I thought the {} might help but evidently not.
> Any ideas, pointers, tips?
>
> (been through Camel, Llama, FAQ, and Dejanews without any leads).
Have you seen the question from perlfaq5, "How can I make a filehandle
local to a subroutine? How do I pass filehandles between subroutines?
How do I make an array of filehandles?" If so, and you're still
unsure about how to proceed, let us know, and we'll earn that pint.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: 20 Aug 1998 07:25:39 -0700
From: Brad Murray <murrayb@vansel.alcatel.com>
Subject: Re: such a thing as a "perl user"?
Message-Id: <uzpczzq58.fsf@vansel.alcatel.com>
John Callender <jbc@west.net> writes:
> Perl has made the easy things so easy that maybe you don't even have to
> be a real programmer to use it. You can be like me, just a user. And
> maybe that's okay.
John, there are lots of us out here who are never going to be Perl gurus,
but who are real programmers and write solid, functioning, cheap to
maintain tools in Perl that get real work done. Don't be discouraged
because you can't win the Obfuscated Perl contest (or even understand
its entries), because in the end, who cares? If you get real work done
with Perl then you are miles ahead of anyone toying with the vagaries
of its syntax to create spinning Perl Journal logos.
Not that I want to disparage the OP contest--I think it's a hoot and
I regularly marvel over the source code of the entrants, but I don't think
that that level of language knowledge is useful to everyone. It's a case
of putting in ten times more effort to get an extra 5% utility. If you
do good work with Perl, you should be pleased with yourself. And call
yourself a programmer. Users only run your software.
--
Brad Murray "If you can't easily replace your oven, don't use it
Software Analyst for science experiments."
Alcatel Canada --Paul Haas
------------------------------
Date: Thu, 20 Aug 1998 15:36:59 GMT
From: "Rick Koehler" <rkoehler@osmre.gov>
Subject: Re: such a thing as a "perl user"?
Message-Id: <ExzvCK.FGH@igsrsparc2.er.usgs.gov>
John Callender wrote ...
>[snipotomy] ...
>As much as I love accomplishing really awesome tasks with perl (awesome
>for me; not awesome for you), I have to recognize that I will *never*
be
>JAPH. I just started too late, or don't have the aptitude, or
something,
[snipski]
>I'm curious what others think about this.
And Steve Linberg wrote ...
>[snip-poingo] ... But we can read the groups and help newbies now and
>then and learn from people who know more than us, and just keep
>climbing! ...
Yup. Pretty much what I feel. I can still enjoy shooting hoops on a
hardwood court, even though I may somewhat reek as a b-ball player.
And I can enjoy my little victories in Perling as they come, even though
I don't code full time, and will undoubtably never understand the full
elegance of the language.
As far as being JAPH, nope, I'll likely never deserve the "title", but I
can be Just Another Pilgrim on the Road to Perldom (JAPOTRTP),
or some such lesser appellation. One can still enjoy the trip and
learn things along the way, and help others you meet on the journey.
I suspect there are many who do some minor programming in Perl,
either as part of their job, or just for fun, who read this list, and
may
even have the nerve (the NERVE !!) to post a question. As has been
thoroughly sliced and diced in this newsgroup, yeah, they should
avail themselves of the tools they already have before asking
something covered in the FAQ, etc.
But to expect them to be able to recite, chapter and verse, from the
Camel, etc., is kinda extreme. I don't want to shock anyone, but it
is possible that perhaps some of these sources aren't the most
lucidly written tomes on the planet. And perhaps, if someone is
not a Perl guru, they might struggle to understand a concept that
seems plainly expounded to "the masters" (the Perl Overlords ?).
Granted, there is a lot of cluelessness in c.l.p.m., and a certain
amount
of smug arrogance, too. But there are many helpful souls out there
who a willing to lend a hand. You know who you are. Thanks.
------------------------------
Date: Thu, 20 Aug 1998 18:17:02 GMT
From: mt@dev.null (Mads Toftum)
Subject: Re: Trouble with Net-SSL
Message-Id: <35dc66ab.9246283@news.inet.tele.dk>
Hello,
On some Unix boxes I've had coredumps while using that module. By
testing using the s_client from ssleay I found out that it ssleay that
crashed.
The easiest way to fix it was to force it to use either ssl v2 or 3,
but not allowing it to negotiate with the server. You can do that by
uncommenting a line in SSLeay.pm that specifies which version to use.
There's a comment in the source that explains how.
On Thu, 20 Aug 1998 16:04:48 +0200, Falk Hartmann
<f.hartmann@intershop.de> wrote:
>Hi all,
>I have trouble using Net-SSL v1.02 on a WinNT machine. It compiles
>without problems, using SSLeay v0.9.0(b), but it causes Perl to crash
>when invoking the module. Does anyone encounter similar problems and can
>provide any hint that might help?
>
>Thanx in advance,
>Falk
>
vh.
Mads Toftum, (QDPH/JAPH)
---
A computer lets you make more mistakes faster than any other invention, with the possible exceptions of handguns and Tequilla.
-- Mitch Ratcliffe
------------------------------
Date: Thu, 20 Aug 1998 11:48:16 -0400
From: "Matt Edwards" <matt.edwards@thinkinc.com>
Subject: undef $/ in one-liner?
Message-Id: <6rhgfj$ksr$1@strato.ultra.net>
I can't seem to use to any avail:
perl -pi.bak -e 'undef $/; s/foo\nbar/foo bar\n/g' foobar.txt
foobar.txt looks like this:
foo
bar
abcdefghijklmnopqrstuvwxyz
I should look like this:
foo bar
abcdefghijklmnopqrstuvwxyz
_Matt Edwards
_matt.edwards@thinkinc.com
This message is sent in compliance with the new e-mail bill: SECTION 301,
Paragraph (a)(2)(C) of s. 1618
------------------------------
Date: Thu, 20 Aug 1998 16:16:27 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: undef $/ in one-liner?
Message-Id: <6rhhbe$re$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <6rhgfj$ksr$1@strato.ultra.net>
"Matt Edwards" <matt.edwards@thinkinc.com> wrote:
>I can't seem to use to any avail:
>
>perl -pi.bak -e 'undef $/; s/foo\nbar/foo bar\n/g' foobar.txt
You are running the equivalent of-
while(<>){
undef $/;
s/foo\nbar/foo bar\n/g;
} continue {
print or die "-p destination: $!\n";
}
So you are reading in the first line before you undef $/,
which obviously causes problems. Try-
perl -pi.bak -e 'BEGIN { undef $/ } s/foo\nbar/foo bar/g' foobar.txt
Also note that your original will add an extra \n after
bar.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: 20 Aug 1998 12:16:24 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "Matt Edwards" <matt.edwards@thinkinc.com>
Subject: Re: undef $/ in one-liner?
Message-Id: <ww83a80n.fsf@mailhost.panix.com>
"Matt Edwards" <matt.edwards@thinkinc.com> writes:
> I can't seem to use to any avail:
>
> perl -pi.bak -e 'undef $/; s/foo\nbar/foo bar\n/g' foobar.txt
You may either
perl -pi.bak -0777 's/...
which is obscure, though documented in perlrun, or you may
perl -pi.bak -e 'BEGIN { undef $/ } s/...
which is entirely too much typing. :)
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
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 3492
**************************************