[9812] in Perl-Users-Digest
Perl-Users Digest, Issue: 3405 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 10 12:07:14 1998
Date: Mon, 10 Aug 98 09:01:29 -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 Mon, 10 Aug 1998 Volume: 8 Number: 3405
Today's topics:
Re: posting to external script within perl <merlyn@stonehenge.com>
Re: problem with exec call in cgi-bin program (Andrew M. Langmead)
Regex problem <l.e.kolden@hfstud.uio.no>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: String comparison problem <jdw@dev.tivoli.com>
Re: variable indirection [off topic - parens] <jdporter@min.net>
Re: Where can I find the binary for perl at least 5.002 (Jim Weisgram)
Re: Windows 95 perl and long-directory names. <dparrott@ford.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 10 Aug 1998 14:24:01 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: posting to external script within perl
Message-Id: <8ciuk0vrt5.fsf@gadget.cscaper.com>
>>>>> "Dan" == Dan Bassett <dan@bns.com> writes:
Dan> I am trying to find the correct module that will allow me to
Dan> post form input from a script on my server to a script
Dan> located on another server and then read back the results
Dan> of the external script...
This message was also posted to comp.lang.perl.modules.
DON'T answer here. See the thread over there.
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Mon, 10 Aug 1998 14:44:23 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: problem with exec call in cgi-bin program
Message-Id: <ExHA9z.BIH@world.std.com>
joanna <joanna@ecas.org> writes:
>$programToRun = 'perl blabla.pl';
>exec $programToRun;
>with this code, program 2 blabla.pl is properly executed. However, this
>works fine only when I run program 1 from the command line. When I
>insert the code of program 1 in a larger perl program that is actually
>in a cgi-bin directory, nothing seems to happen, including an error
>message. In other words, when an html form starts a post operation
>adressing the large perl program located in cgi-bin, the exec related
>lines code do not start program 2.
First of all, do you mean exec() (stop execution of the current
program, and replace it with the new program) or do you mean system()
(execute the new program and then return to the first.)
Secondly, if you test for the success of exec() you may have a better
idea of your problems.
exec $programToRun or die "Can't exec $programToRun: $!\n";
Since exec is never supposed to return, emits a warning if you have
additional statements between the exec and the end of the current
block. One way around this, if you need it, is to put the exec in a
block by itself.
{
exec $programToRun;
}
$error = "Can't exec $programToRun: $!";
syslog 'alert', '%s', $error;
print htmlify("An error occured: please notify $email: Error: $error")
Of course, if you meant system() rather than exec(), this won't apply.
A possible reason why it works on the comand line and not in the
cgi-bin directory, is that the environment given the script by the web
server may be different. (Is the current directory the cgi-bin
directory? Is perl in its path?) For help with things like this, you
may want to consult a newsgroup dealing with the HTTP server you are
using.
--
Andrew Langmead
------------------------------
Date: Mon, 10 Aug 1998 17:29:04 +0200
From: Lars Erik Kolden <l.e.kolden@hfstud.uio.no>
Subject: Regex problem
Message-Id: <35CF11BF.49C0D89F@hfstud.uio.no>
Hi,
I'm not a very experienced perl programmer, and need some help with a
small script I'm writing. It's purpose is to delete five lines of html
code that is part of a table and the script takes in data (to put in the
regex) from an html form, but that isn't important here. This is an
example of an html file the script will process (it will allways be of
this format regarding the html). The file has no head part, because that
is added from another file in another script:
<tr>
<td width="43%" align="left" valign="top"><a
href="Trondheim/09-08-98.html">En peker</a></td>
<td width="33%" align="center"
valign="top">09-08-98</td>
<td width="24%" align="center"
valign="top">Trondheim</td>
</tr>
<tr>
<td width="43%" align="left" valign="top"><a
href="Stavanger/09-08-98_1.html">En annen peker</a></td>
<td width="33%" align="center"
valign="top">09-08-98</td>
<td width="24%" align="center"
valign="top">Stavanger</td>
</tr>
<tr>
<td width="43%" align="left" valign="top"><a
href="Oslo/09-08-98.html">Nok en peker</a></td>
<td width="33%" align="center"
valign="top">09-08-98</td>
<td width="24%" align="center" valign="top">Oslo</td>
</tr>
</table>
<span class="normal_tekst"></span>
<p></p>
<p> </p></body>
</html>
As you probably see, I want to delete one row based on information
posted by an html form. Now here is the regex/script I've tried that
doesn't work (the script has two subroutines aswell, 'get_form' and
'error', but it's nothing wrong with them):
#!/usr/bin/perl
$/ = "";
&get_form;
$linktext = $FORM{'linktext'};
$region = $FORM{'region'};
$date = $FORM{'date'};
$body_file = "body.html";
open(BODY, ">>$body_file") || &error(bad_open); # I'm a bit unsure
about how to open a file for substitution.
while (<BODY>) {
s! # here comes the regex, which doesn't match. Even not
if I only open the file for input and uses the
# m operator.
# Line 1
^
\s*
<tr>
\n
# Line 2
.*
$linktext
.*
\n
# Line 3
.*
$date
.*
\n
# Line 4
.*
$region
.*
\n
# Line 5
\s*
</tr>
.*
\n
!!mgx;
}
I get no error messages from the perl debugger when the script is run.
It just doesn't match, so I guess it is the regex that isn't right.
Could somebody please help me. I've got to finish this soon.
Lars Erik Kolden
l.e.kolden@hfstud.uio.no
------------------------------
Date: 10 Aug 1998 15:23:26 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <6qn39e$jqh$3@info.uah.edu>
Following is a summary of articles spanning a 7 day period,
beginning at 03 Aug 1998 14:56:17 GMT and ending at
10 Aug 1998 06:15:04 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" e-mail address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 1998 Greg Bacon. All Rights Reserved.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@mox\.perl\.com
Totals
======
Posters: 549
Articles: 1753 (810 with cutlined signatures)
Threads: 455
Volume generated: 3090.1 kb
- headers: 1291.9 kb (25,124 lines)
- bodies: 1635.2 kb (47,754 lines)
- original: 1063.5 kb (33,634 lines)
- signatures: 161.3 kb (2,968 lines)
Original Content Rating: 0.650
Averages
========
Posts per poster: 3.2
median: 1 post
mode: 1 post - 326 posters
s: 7.1 posts
Posts per thread: 3.9
median: 2 posts
mode: 1 post - 152 threads
s: 11.7 posts
Message size: 1805.1 bytes
- header: 754.7 bytes (14.3 lines)
- body: 955.2 bytes (27.2 lines)
- original: 621.2 bytes (19.2 lines)
- signature: 94.2 bytes (1.7 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
77 204.5 ( 72.1/ 78.4/ 27.5) whatpartofdontemailme@dontyouunderstand
66 91.8 ( 51.3/ 32.8/ 21.0) Tom Phoenix <rootbeer@teleport.com>
53 80.1 ( 45.5/ 33.9/ 16.3) jdporter@min.net
45 95.7 ( 46.4/ 43.0/ 42.2) pudge@pobox.com (Chris Nandor)
44 103.2 ( 36.9/ 60.9/ 53.8) tchrist@mox.perl.com (Tom Christiansen)
37 50.7 ( 23.1/ 25.7/ 13.5) Greg Bacon <gbacon@cs.uah.edu>
35 71.0 ( 31.0/ 34.6/ 13.3) abigail@fnx.com
30 70.4 ( 22.0/ 40.1/ 25.9) Russ Allbery <rra@stanford.edu>
29 54.7 ( 18.5/ 36.3/ 23.9) cberry@cinenet.net (Craig Berry)
23 36.4 ( 15.2/ 19.1/ 11.1) lr@hpl.hp.com (Larry Rosler)
These posters accounted for 25.0% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
204.5 ( 72.1/ 78.4/ 27.5) 77 whatpartofdontemailme@dontyouunderstand
103.2 ( 36.9/ 60.9/ 53.8) 44 tchrist@mox.perl.com (Tom Christiansen)
95.7 ( 46.4/ 43.0/ 42.2) 45 pudge@pobox.com (Chris Nandor)
91.8 ( 51.3/ 32.8/ 21.0) 66 Tom Phoenix <rootbeer@teleport.com>
80.1 ( 45.5/ 33.9/ 16.3) 53 jdporter@min.net
71.0 ( 31.0/ 34.6/ 13.3) 35 abigail@fnx.com
70.4 ( 22.0/ 40.1/ 25.9) 30 Russ Allbery <rra@stanford.edu>
54.7 ( 18.5/ 36.3/ 23.9) 29 cberry@cinenet.net (Craig Berry)
50.7 ( 23.1/ 25.7/ 13.5) 37 Greg Bacon <gbacon@cs.uah.edu>
44.5 ( 11.1/ 30.8/ 21.4) 16 Daniel Grisinger <dgris@rand.dimensional.com>
These posters accounted for 28.0% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.991 ( 21.1 / 21.3) 18 fl_aggie@thepentagon.com (I R A Aggie)
0.985 ( 7.2 / 7.3) 9 tye@fumnix.metronet.com (Tye McQueen)
0.980 ( 42.2 / 43.0) 45 pudge@pobox.com (Chris Nandor)
0.978 ( 4.9 / 5.0) 5 gebis@noble.ecn.purdue.edu (Michael J Gebis)
0.951 ( 6.9 / 7.3) 11 gebis@fee.ecn.purdue.edu (Michael J Gebis)
0.882 ( 53.8 / 60.9) 44 tchrist@mox.perl.com (Tom Christiansen)
0.876 ( 6.7 / 7.7) 5 k y n n <kj0@mailcity.com>
0.846 ( 5.4 / 6.3) 13 "Matthew O. Persico" <mpersico@erols.com>
0.845 ( 1.9 / 2.2) 5 "Martin" <minich@globalnet.co.uk>
0.826 ( 8.2 / 9.9) 6 "Matt Heusser" <matt@pcr7.pcr.com>
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.405 ( 1.4 / 3.5) 5 Dan Sugalski <sugalskd@netserve.ous.edu>
0.385 ( 13.3 / 34.6) 35 abigail@fnx.com
0.373 ( 2.6 / 6.9) 7 phenix@interpath.com (John Moreno)
0.370 ( 1.9 / 5.1) 5 hirano@Xenon.Stanford.EDU (Kelly Hirano)
0.369 ( 1.6 / 4.3) 10 thomas@daimi.aau.dk
0.365 ( 3.3 / 9.2) 9 ac1@fspc.netsys.itg.telecom.com.au (nobody)
0.358 ( 1.3 / 3.7) 5 pearse <pearse@mail.shebang.net>
0.351 ( 27.5 / 78.4) 77 whatpartofdontemailme@dontyouunderstand
0.326 ( 3.3 / 10.2) 14 Randal Schwartz <merlyn@stonehenge.com>
0.314 ( 2.9 / 9.2) 7 Pep Mico <pep_mico@hp.com>
68 posters (12%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
198 hiding user input
130 comp.lang.perl.announce redux
37 perlfaq - frequently asked questions about Perl (part 0 of 9)
29 Perl Docs.. forget the original post
24 ANNOUNCE: Free Perl Books for 5.005 - CRC Errors in text version archive?
23 c.l.p.moderated: not much traffic?
19 Teaching Perl
12 And sometimes the FAQ's suck
12 Intriguing coderef question
11 Retrieving file from REMOTE_ADDR ... HELP!
These threads accounted for 28.2% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
448.6 (181.0/218.8/128.8) 198 hiding user input
268.4 (118.0/131.2/ 73.2) 130 comp.lang.perl.announce redux
67.3 ( 24.0/ 39.7/ 24.4) 29 Perl Docs.. forget the original post
58.7 ( 29.7/ 25.8/ 18.6) 37 perlfaq - frequently asked questions about Perl (part 0 of 9)
48.4 ( 6.2/ 41.8/ 38.6) 9 Can't Match Multi-Line Pattern
46.7 ( 22.1/ 20.8/ 12.3) 24 ANNOUNCE: Free Perl Books for 5.005 - CRC Errors in text version archive?
41.0 ( 1.6/ 39.3/ 1.9) 2 Excel-Chart OLE Perl Scripts
35.3 ( 14.0/ 19.9/ 11.1) 19 Teaching Perl
29.0 ( 17.4/ 9.5/ 6.2) 23 c.l.p.moderated: not much traffic?
22.6 ( 8.3/ 14.0/ 7.8) 11 re first language
These threads accounted for 34.5% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.922 ( 38.6/ 41.8) 9 Can't Match Multi-Line Pattern
0.878 ( 2.3/ 2.6) 5 MacPerl fully compatible? (directory problems)
0.876 ( 4.7/ 5.3) 5 strange results from tied hash
0.854 ( 11.3/ 13.2) 10 wtf is the obsession with "foo" and "bar"
0.841 ( 5.7/ 6.7) 9 Setting $ENV{LD_LIBRARY_PATH} doesn't work
0.841 ( 7.1/ 8.5) 5 ODBC, Perl, Unix and Macs
0.831 ( 5.5/ 6.6) 8 Can't make flock work as described...
0.817 ( 3.2/ 4.0) 6 Help Help Please Help !
0.807 ( 7.5/ 9.3) 7 math error
0.802 ( 2.7/ 3.4) 5 ch
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.488 ( 1.8 / 3.8) 8 diff-like utility in Perl?
0.486 ( 1.3 / 2.7) 5 wildcards don't work with link function?
0.481 ( 1.6 / 3.3) 5 IPC semaphores in Perl under FreeBSD
0.465 ( 1.9 / 4.1) 8 What is the purpose of Perl
0.461 ( 1.5 / 3.2) 7 perl 5.005: Binary Distribution for Win32?
0.455 ( 2.2 / 4.9) 6 Reading in one file and writing to another
0.448 ( 1.9 / 4.2) 6 Putting \r\n at end of lines using format and write
0.438 ( 1.0 / 2.3) 6 Executing a Perl script from a hyperlink
0.436 ( 1.3 / 3.0) 5 Set-Cookie
0.416 ( 2.5 / 6.1) 8 "Here" documents and the mystery that is FTP
91 threads (20%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
34 comp.lang.perl.modules
10 comp.lang.perl
9 alt.perl
7 comp.lang.perl.tk
7 comp.lang.perl.moderated
6 comp.os.linux.misc
5 comp.lang.javascript
4 comp.sys.sun.admin
4 comp.unix.bsd.freebsd.misc
4 comp.unix.admin
Top 10 Crossposters
===================
Articles Address
-------- -------
14 toni@usenix.org (Toni Veglia)
11 "Manfred Schneider" <manfred.schneider@rhein-neckar.de>
9 dOOMSdAY@STARDATE.WESTFALEN.DE (Max von Weissenborn)
8 Tom Phoenix <rootbeer@teleport.com>
7 Tom Giering <tgiering@fccmail.com>
6 "Host Investigator" <investigators@iglobe.net>
6 "Norman Bunn" <norman.bunn@mci.com>
5 perlguy@technologist.com
5 kulakov@kulakov.msk.ru
5 float@interport.net (void)
------------------------------
Date: 10 Aug 1998 08:59:16 -0500
From: "Jim Woodgate" <jdw@dev.tivoli.com>
Subject: Re: String comparison problem
Message-Id: <obzpdd0wgb.fsf@alder.dev.tivoli.com>
gt2863a@acmey.gatech.edu (Mark Conlin) writes:
> if ($submit{'orginal'} eq $name){
^^^^^^^
>
> this was not working so I decided to print the two strings to see
> what was going on so
>
> print OUTFILE "org = $submit{'original'}\n";
> print OUTFILE "current = $name \n";
> if ($submit{'orginal'} eq $name){
^^^^^^^
shouldn't that be 'original'
--
Jim Woodgate
Tivoli Systems
E-Mail: jdw@dev.tivoli.com
(512)436-8134
------------------------------
Date: Mon, 10 Aug 1998 11:38:01 -0400
From: John Porter <jdporter@min.net>
Subject: Re: variable indirection [off topic - parens]
Message-Id: <35CF13D9.48E8@min.net>
Nem W Schlecht wrote:
>
> The above, non-paren statement, should be written as:
>
> my($foo) = scalar @bar;
"should be"???
I'm not sure you're qualified to be pontificating.
If you really think parens are so important and non-optional
(stylistically speaking), then you should have at least said
scalar( @bar )
But worse than that, you are promoting a style of
assignment like this:
( $x ) = $y;
Which is certainly in a class with
@z = $y;
I think we all agree that these forms are Bad.
If you would write
$foo = scalar( @bar );
then you would also write
my $foo = scalar( @bar );
because the semantics are identical -- except for the
effect of 'my' on the scope of $foo, obviously.
--
John Porter
------------------------------
Date: Mon, 10 Aug 1998 14:22:05 GMT
From: jweisgram@hotmail.com (Jim Weisgram)
Subject: Re: Where can I find the binary for perl at least 5.002 (better 5.005) for Windows NT4.0 ?
Message-Id: <35d500f2.56497026@news.teleport.com>
"Marcus T|rner" <Marcus@Tuerner.de> wrote:
>The page of www.perl.com directs me to a site whisch promise 5.003 and
>if I download it it's only 5.001.
>I searched about an hour and found only sources, but I need the ready
>made Software because I'm not a Softwaredeveloper and have no
>opportunity to compile anything.
>
>Please Help!
>
>Thanx!
>
>Marcus
Hmm, when I follow the www.perl.com link I get to a binary of 5.004_02 quite
quickly. You can follow the links to CPAN from your starting point and it will
fairly quickly take you to this version. Also, each day I see several posts in
comp.lang.perl.misc that give a direct link to this "GS" version of Perl.
Check out www.activestate.com. They have 5.005, and as I understand it, will be
the standard Win 32 Perl source from now on.
--
All opinions expressed are mine and not my employers (but they ought to be)
Jim Weisgram
Oregon Department of Transportation
------------------------------
Date: Mon, 10 Aug 1998 10:17:35 -0400
From: "Dennis M. Parrott" <dparrott@ford.com>
To: "Peter P. Mikelonis" <mikeloni@altair.com>
Subject: Re: Windows 95 perl and long-directory names.
Message-Id: <35CF00FF.150B@ford.com>
Try surrounding your LFN's with quotes (").
This trick has worked for me in various
scripts.
Peter P. Mikelonis wrote:
>
> I am having difficulty doing existence checking, (-e), if my string
> contains a path with
> an item greater than 8 characters. Has any one else experienced this and
> is
> there a work around. The script was developed on NT and works fine.
>
> Please e-mail me if you can
>
> Thanks.
>
> --
> ==================================================================
> Pete Mikelonis | Url : http://www.altair.com
> Altair Computing, Inc. | Email: mikeloni@altair.com
> 1757 Maplelawn Drive | Phone: (248) 614-2400 ext 239
> Troy, MI 48084-4004 | Fax : (248) 614-2411
> ==================================================================
--
-----------------------------------------------------------------------
Dennis M. Parrott | Unix: dparrott@ford.com
PCSE Webmaster | PROFS: DPARROTT
Ford Motor Company | VAX: EEE1::PARROTT
Dearborn, Michigan USA | public Internet: dparrott@ford.com
-----------------------------------------------------------------------
Voice: 313-322-4933 Fax: 313-248-1234 Pager: 313-201-9978
------------------------------
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 3405
**************************************