[6809] in Perl-Users-Digest
Perl-Users Digest, Issue: 435 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 5 16:17:12 1997
Date: Mon, 5 May 97 13:01:51 -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, 5 May 1997 Volume: 8 Number: 435
Today's topics:
Re: Perl 5.003 bug??? (Chipmunk)
Re: PERL Editor (Michael James Braunstein)
Re: perl IDE? (Brooks Davis)
Re: Perl on NT Servers (Andrew M. Langmead)
Perl, Cookies, Location edz@raw.net
PerlScript (activeserverpages) and setting a cookie ? <soderlind@gazette.no>
PerlScript <dsmeltz@badg.com>
Re: pre-RFD: comp.lang.perl.{data-structure,inter-proce (A. Deckers)
Re: pre-RFD: comp.lang.perl.{data-structure,inter-proce (Tung-chiang Yang)
Re: Printing to Files. (Chip Salzenberg)
Re: problem with bootstrap in a module (SOLVED) <dmi1@ra.msstate.edu>
Re: Problem with uppercase reg exp (Tad McClellan)
Re: Problems Building Perl WIN32 on NT (Gurusamy Sarathy)
Re: problems with the debugger <lpa@sysdeco.no>
Randal Teaching Open Enrollment Advanced Perl Class in <s..vanechanos@postoffice.worldnet.att.net>
Script runs fine from shell, but browser doesn't receiv (Jeffrey Morgan)
select() wierdness <kstevens@globeandmail.ca>
Server needed for Win95? <zonycat@flash.net>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Substituting multiple lines (Kilpilinna Sami)
Re: Substituting multiple lines (Tad McClellan)
Re: Urgent help needed! State abbreviation conversion <seay@absyss.fr>
Re: Urgent help needed! State abbreviation conversion <sib@worldnet.att.net>
Re: Who Are You? (Brooks Davis)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 May 1997 00:23:05 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Perl 5.003 bug???
Message-Id: <5kj999$2g$2@dartvax.dartmouth.edu>
In article <5kamnd$s6g@cri.ens-lyon.fr>
Vincent Lefevre <vlefevre@ens-lyon.fr> writes:
> Thanks for all the replies. Now, this does not explain why the following
> script does *not* die:
>
> foreach ("a 0","b 0")
> {
> print "1 $_\n";
> "a" =~ // or die;
> if (1)
> {
> print "2 $_\n";
> / / and print "3 $_\n";
> }
> }
I think that the last successfully executed regular expression which a
null pattern is evaluated as may be subject to scoping. So, the / /
within the if statement is local to the if statement.
Note that I'm not certain of this, however.
Chipmunk
------------------------------
Date: 5 May 1997 17:30:18 GMT
From: mjb1@alpha3.csd.uwm.edu (Michael James Braunstein)
Subject: Re: PERL Editor
Message-Id: <5kl5fa$fnb@uwm.edu>
Kyzer wrote:
: Dick Barker of dickb@eskimo.com wrote in comp.lang.perl.misc:
: : Real perl programmers use cat >fname to write their stuff.
: Actually they use emacs.pl :)
:
emacs.pl, where can i get it, or is this just a euphemism for somthing
else?
-mjb
------------------------------
Date: 4 May 1997 19:53:46 GMT
From: brdavis@orion.ac.hmc.edu (Brooks Davis)
Subject: Re: perl IDE?
Message-Id: <5kipgb$716$1@cinenews.claremont.edu>
Bryan Green (green@primenet.com) wrote:
: Is there any kind of IDE for perl?
Not specificaly, that I know of. I don't think the Perl community could
agree on what an editor should do enough to actually create a single
standard IDE.
However, there is an emacs mode which tries to make your code conform to
its programmer's idea of perl code. Also, nvi and elvis have have syntax
highlighting modes for perl. I think BBEdit has a perl mode and I've
heard good things about it as a PC/Mac editor. As to Visual C++, I really
don't know.
-- Brooks
------------------------------
Date: Sun, 4 May 1997 14:23:46 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Perl on NT Servers
Message-Id: <E9nunn.n0o@world.std.com>
John Giblin <giblin@mail.idt.net> writes:
>I just moved from a unix to a NT Server. I have change the ext. to .pl,
>but when I hit the submit button it asks me where to save the script.
>Do I have to do anything else?
1. Install TCL interpreter.
2. Associate the TCL interpreter with the .tcl extension.
3. Try to execute this CGI script.
#!/usr/bin/tclsh
puts "Content-Type: html\n\n"
puts "<HEAD><TITLE>This is a TCL script</TITLE></HEAD>\n"
puts "Hello World!<P>\n"
4. Realize that your server configuration problem has nothing to do
with the specific interpreter you are trying to install. Try to figure
out where people who use your brand of HTTP server hangs out.
--
Andrew Langmead
------------------------------
Date: Sun, 04 May 1997 22:46:16 GMT
From: edz@raw.net
Subject: Perl, Cookies, Location
Message-Id: <336d112c.192895705@nntp.ix.netcom.com>
After my script sets cookies, I can't get it to throw "Location:
http://www.your.com" to the browser... Any ideas?
Thanks
EdZ
------------------------------
Date: Mon, 05 May 1997 19:51:03 +0200
From: Per Soderlind <soderlind@gazette.no>
Subject: PerlScript (activeserverpages) and setting a cookie ?
Message-Id: <336E1E07.70400518@gazette.no>
Hi,
I'm trying to set a cookie using PerlScript;
In VBscript the syntax is;
Response.Cookies("CookieName") = "CookieValue"
Since I don't like VB (please don't start a VB vs Perl war), I'm using
PerlScript on the IIS 3.0 platform. PerlScript is real nice, but there
is a small problem - the lack of documentation. Looking at the VBscript
doc, I thought the Perl equivalent had to be;
$Respose->cookies("CookieName") = "CookieValue";
But it's not.
Does anyone know the correct syntax ?
rgds,
Per
--
--------------- Gazette AS - http://www.gazette.no -------------
Per Soderlind: WebMaster from Hell - http://www.hell-blues.nt.no
mailto:soderlind@gazette.no
----------- Tel: +47 2233 4410 ---- Fax: +47 2233 4430----------
------------------------------
Date: Sat, 03 May 1997 15:37:53 GMT
From: "Dan Smeltz" <dsmeltz@badg.com>
Subject: PerlScript
Message-Id: <01bc57cf$72e09960$af1b29cf@danno>
Hi,
Anyone have experience using PerlScript with Microsofts Active Server
Pages?
I'm trying to figure out how to set variables in the $Application and
$Session objects.
Thanks,
Dan
------------------------------
Date: 4 May 1997 17:30:26 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: pre-RFD: comp.lang.perl.{data-structure,inter-process,porters,regex}
Message-Id: <slrn5mphti.es1.I-hate-cyber-promo@news.rediris.es>
In comp.lang.perl.misc,
mfiresto@mindspring.com wrote:
>Just a few questions ( or maybe concerns ) about the moderation rules.
>
>First, would there be a set of guidelines so those who would like to
>post to the moderated group can make sure their posting will be
>accepted?
Yes, that would be in the groups charter, which would have been passed
by a public vote. The moderation panel would arrange to have it
published in the group at regular intervals.
>Second, if a posting is rejected, will there be notification that it
>was rejected? Speaking for myself, if I did not see the post in a
[...]
>Finally, if a post has been rejected, would there be anything telling
>me why it had been rejected? In light of some of the criteria (
[...]
Yes and yes. The article would be returned together with the group's
charter and an explanation of why the article was rejected.
Cheers,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<
------------------------------
Date: Sun, 4 May 1997 20:58:02 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: pre-RFD: comp.lang.perl.{data-structure,inter-process,porters,regex}
Message-Id: <tcyangE9oCwr.IB4@netcom.com>
A. Deckers (I-hate-cyber-promo@man.ac.uk) wrote:
: (deleted)
: >Second, if a posting is rejected, will there be notification that it
: >was rejected? Speaking for myself, if I did not see the post in a
: [...]
: >Finally, if a post has been rejected, would there be anything telling
: >me why it had been rejected? In light of some of the criteria (
: [...]
: Yes and yes. The article would be returned together with the group's
: charter and an explanation of why the article was rejected.
To enable this, you had better clearly specify either of the followings:
(1) posts with valid return address only, or
(2) if the poster chooses to use a munged address, he/she would not receive
any explanations for being rejected.
--
Tung-chiang Yang tcyang@netcom.com
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.clever.net/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: 5 May 1997 17:44:13 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: Re: Printing to Files.
Message-Id: <5kl69d$moi@news.atlantic.net>
According to Carey Evans <c.evans@clear.net.nz>:
>really_eliot@dg-rtp.dg.com_but_mangled_to_stop_junk_email writes:
>> I've wondered about how to flush a file exactly once, and why such an
>> "fflush" functionality doesn't appear to be part of standard perl.
>> Care to expand on how to do it with $| ?
It is in Perl, as FileHandle::flush (old) or IO::Handle::flush (new).
>I've always done it with something like the following (if you want to
>leave it off):
>
> $| = 1; print ""; $| = 0;
>
>You can probably use blocks and local to leave it alone.
Yes: { local $| = 1; print "" }
But in Perl 5.004, just saying { local $| = 1 } is enough.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Men of lofty genius are most active
when they are doing the least work."
-- Leonardo da Vinci
------------------------------
Date: 04 May 1997 20:20:06 -0500
From: David Ishee <dmi1@ra.msstate.edu>
Subject: Re: problem with bootstrap in a module (SOLVED)
Message-Id: <m367wyyat5.fsf@gsubc.dot.edu>
David Ishee <dmi1@ra.msstate.edu> writes:
> I've got a perl script that uses Msql.pm to access a mSQL database
> from perl. It was working, but I upgraded my Red Hat Linux system from
> 4.0 to 4.1 and now the script will not work. When I try to run it I
> get this error:
>
> Can't find loadable object for module Msql in @INC
> (/usr/lib/perl5/i386-linux/5.003 /usr/lib/perl5
> /usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl .) at
> /usr/lib/perl5/site_perl/Msql.pm line 70 BEGIN failed--compilation
> aborted at ./pbook line 5.
>
> line 70 of Msql.pm is: bootstrap Msql;
>
> I'm using perl 5.003 with EMBED.
>
> What is going on here? This is very annoying since I use this script
> frequently.
After some helpful email, I re-installed Msql.pm and it works.
--
David
+--------------------------------------------------------------------+
| David Ishee |
| MS grad student, Mechanical Engineering dmi1@ra.msstate.edu |
| Mississippi State University |
| |
+------------- http://www2.msstate.edu/~dmi1/index.html -------------+
------------------------------
Date: Mon, 5 May 1997 07:09:33 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Problem with uppercase reg exp
Message-Id: <tlikk5.321.ln@localhost>
mel@west.net wrote:
: Hi,
:
: I'm somewhat new to PERL and am having a problem with case pattern
: matching. Specifically, I'm trying to convert, for example,
: weight_unit to Weight Unit. So far I've done this:
: $x = "weight_unit";
: $x =~ s/_/ /g; # convert underscores to spaces
: $x =~ s/^\ba-z/A-Z/g; # convert 1st letter of each word to uppercase
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think if you do a word search for 'first character' in the perl
man pages, that come with the perl distribution, you might find
a function that uppercases the first letter of a word...
Your pattern matches a word boundary, followed by the three characters
'a', '-', and 'z'. You can use ranges in a char class, but you don't
have a character class.
: But all I get back is: weight unit. Can someone help with me with
: this? I've tried some sensible variations, but none worked.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 5 May 1997 14:33:05 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: Problems Building Perl WIN32 on NT
Message-Id: <5kkr31$5cd@srvr1.engin.umich.edu>
[ mailed and posted ]
In article <01bc48cd$22508890$66ef49c1@gbspc02>,
Jerome R. Westrick <jerry@gbs.ch> wrote:
>1- I've downloaded Pw32s306.zip from CPAN...
[...]
>4- I change to the "D:\Program Files\Perl5\ntt" directory and run test...
>
>Unfortunately, [many tests fail...]
[...]
>Failed 3/110 tests, 97.27% okay.
[...]
>can any one give me pointers, to where I should look?
>
>Thanking everyone in advance, Jerry
>
>P.S. I'm building from source since I wish to use the DATA::DUMPER module
> And it requires recompilation of the source. Correct?
If you want to build most CPAN modules, I suggest you try the
win32 support in the latest perl distribution (which is in
gamma test, 5.003_99). The steps are:
<download perl5.003_99 from CPAN>
gzip -c -d perl5.003_99.tar.gz | tar xmf -
cd perl5.003_99\win32
<read README.win32,pod\perldelta.pod>
nmake
nmake test
nmake install
cd ..
<download Data-Dumper-2.07 from CPAN>
gzip -c -d Data-Dumper-2.07.tar.gz | tar xmf -
cd Data-Dumper-2.07
<read README>
nmake
nmake test
nmake install
cd ..
<..ad nauseum..>
See how the process is idempotent?
For ports of some of the Win32::Extensions see
"$CPAN/authors/id/GSAR/libwin32-0.02.tar.gz", building
which requires the same grind.
Then there is C<perl -MCPAN -e shell> but I will let
you discover that for yourself.
If you find any problems with the win32 support, please
report them to perlbug@perl.com with "perl -V" output
and plenty of details on what went wrong.
- Sarathy.
gsar@umich.edu
------------------------------
Date: Mon, 05 May 1997 12:15:15 +0200
From: Luca Passani <lpa@sysdeco.no>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: problems with the debugger
Message-Id: <336DB333.6E55@sysdeco.no>
Actually it's the latest beta. If the noise is normal anyway, than the
problems might be due to the fact that I "use" a lot of packages in the
beginning.
139: lpa (tiger/HP-UX) ### perl -v
This is perl, version 5.003_93
Thanx for taking the time to write
Luca
Tom Phoenix wrote:
>
> On Fri, 2 May 1997, Luca Passani wrote:
>
> > Every time I start the debugger I get all of these messages, even though
> > everyhting seems to work OK afterwards.
>
> It looks like the usual noise from the debugger, but it goes on an awful
> lot longer than usual. What version of Perl are you using? (The beta for
> 5.004 is supposed to be much quieter when it starts the debugger.) Does it
> still happen when you install a more recent version?
>
> -- Tom Phoenix http://www.teleport.com/~rootbeer/
> rootbeer@teleport.com PGP Skribu al mi per Esperanto!
> Randal Schwartz Case: http://www.lightlink.com/fors/
--
======================================================================
Luca Passani. | Sysdeco Innovation AS, http://www.sysdeco.no
Email: lpa@sysdeco.no | Trondheimsveien 184, 0570 Oslo, Norway
Tel: (+47) 22 09 66 06 | Fax: (+47) 22 09 65 03
======================================================================
------------------------------
Date: 5 May 1997 02:51:25 GMT
From: Steve Vanechanos <s..vanechanos@postoffice.worldnet.att.net>
Subject: Randal Teaching Open Enrollment Advanced Perl Class in NYC/NJ Area
Message-Id: <5kjhvd$qnp@mtinsc05.worldnet.att.net>
We are sponsoring an open enrollment, one day advanced perl class, taught
by Randal Schwartz on May 15th.
Details at http://www.dynamicweb.com/perl_class.html
--
Steve Vanechanos, CEO http://www.dynamicweb.com
DynamicWeb Enterprises, Inc Voice: 201-244-1000
271 Rt 46 West; Building F Fax: 201-777-7428
Fairfield NJ 07004 Email: stevev@dynamicweb.com
------------------------------
Date: Mon, 05 May 1997 18:48:37 GMT
From: myxx@sel-mor.com (Jeffrey Morgan)
Subject: Script runs fine from shell, but browser doesn't receive variables
Message-Id: <336e2965.22056503@news.atl.mindspring.com>
I have a script that simply reads a directory, stores the file names
in an array, uses those filenames to open a string of text files and
print the output to the browser that calls the script.
>From the shell it works great, but from the browser I get not out put.
To test it, I disabled the part where it reads the files themselves
and tried to get it to just print the file names. This too works from
shell but not from the browser.
I even put in a test print statement that prints to the browser fine
just before the expected list of file names, but no go.
Here is my script:
#!/usr/bin/perl
require "cgi-lib.pl";
&ReadParse (*input);
$pathtogroup="/path to a group/";
$fullpathtogroup="fullpath to a group/";
($sec,$min,$hour)=localtime(time);
$ip = $ENV{'REMOTE_ADDR'};
print "Content-type: text/html", "\n\n";
print "<HTML>", "\n";
print "<HEAD><TITLE>Test.pl</TITLE></HEAD>", "\n";
print "<BODY>", "\n";
&getdir;
print "All files \n"; # this is my test line. It prints fine.
print @allfiles; # this will not appear in my browser, not in shell
print "</BODY></HTML>", "\n";
sub getdir{
opendir (jeff, "$fullpathtogroup$group\/");
@allfiles=readdir (jeff);
closedir jeff;
print "@allfiles","\n"; # this wont work either
$i=2; # this routine opens the files and prints the whole contents
# to the shell, but wont print in browser
while (@allfiles[$i]) {
open (blah, "$fullpathtogroup$group\/@allfiles[$i]");
@lines=<blah>;
close (blah);
print "$fullpathtogroup$group\/@allfiles[$i]\n" ;
#print "##\n@lines";
# print "@allfiles[$i]\n";
$i++;
}
return
}
I think it must be the way that @allfiles is being sent. Still, the
browser should pick it up.
Any ideas?
------------------------------
Date: Mon, 05 May 1997 14:45:27 -0400
From: Ken Stevens <kstevens@globeandmail.ca>
Subject: select() wierdness
Message-Id: <336E2AC7.2336@globeandmail.ca>
Hi all!
select() is wierd. I've read most of the docs, and I'm still mystified
as to how on earth select() is able to change the value of $rout. At
first I thought that maybe function($out=$in) is some strange syntax for
passing by reference I'd never heard of, but then I tried to use it and
couldn't figure out how to code the called subroutine so that it gets
the reference. Now, I'm inclined to believe that select() is totally
out-of-band and is a wierd syntactical exception in perl. It almost
looks like it's implemented as a macro, where the macro is expanded in
place, thus gaining access to the arguments locally. Is this wierdness
explained somewhere in my favourite book "Programming Perl"?
Sincerely,
Very Curious
my($rin, $win, $ein, $rout, $wout, $eout);
$rin = $win = $ein = '';
open(TEST, 'test.pl') || die "can't open";
vec($rin, fileno(STDIN), 1) = 1;
vec($rin, fileno(TEST), 1) = 1;
$ein = $rin;
select($rout=$rin,$wout=$win,$eout=$ein,undef);
print "rin STDIN " . vec($rin, fileno(STDIN), 1) . "\n";
print "rin TEST " . vec($rin, fileno(TEST), 1) . "\n";
print "rout STDIN " . vec($rout, fileno(STDIN), 1) . "\n";
print "rout TEST " . vec($rout, fileno(TEST), 1) . "\n";
------------------------------
Date: Sun, 04 May 1997 21:35:54 -0700
From: Dennis <zonycat@flash.net>
Subject: Server needed for Win95?
Message-Id: <336D63AA.6454@flash.net>
Looks, more and more like I must have someserver to run my CGI scripts
from my local PC. I vae perl scripts and CGI scripts on my PC and just
want to test them without putting them on a WEB page on the network.
I can execute scripts sort-of locally, but WIN95 and Netscape (or MS
Explorer) do not execute my scripts as I would expect. Get the
"offline" mode message...
(offline mode: enter name=value pairs on standard input)
So is there any way around this or am I stuck with buyung Server
Software or using some WEB site to test my scripts?
Thanks,
Dennis
------------------------------
Date: 4 May 1997 20:20:48 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <5kir30$r82$1@info.uah.edu>
Following is a summary of articles spanning a 7 day period,
beginning at 26 Apr 1997 08:56:28 GMT and ending at
03 May 1997 06:19:21 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^(>|:|\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.
Excluded Posters
================
perlfaq-suggestions@mox.perl.com
Totals
======
Total number of posters: 500
Total number of articles: 1082
Total number of threads: 376
Total volume generated: 1935.4 kb
- headers: 785.8 kb
- bodies: 1085.6 kb (771.7 kb original)
- signatures: 61.6 kb
Averages
========
Number of posts per poster: 2.2
Number of posts per thread: 2.9
Message size: 1831.6 bytes
- header: 743.6 bytes
- body: 1027.4 bytes (730.4 bytes original)
- signatures: 58.3 bytes
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
45 67.9 ( 35.9/ 31.9/ 23.1) Tom Phoenix <rootbeer@teleport.com>
40 80.1 ( 23.8/ 56.3/ 31.2) Tad McClellan <tadmc@flash.net>
26 41.0 ( 18.0/ 23.0/ 12.0) Chipmunk <Ronald.J.Kimball@dartmouth.edu>
25 39.6 ( 14.4/ 25.1/ 13.8) David Alan Black <dblack@icarus.shu.edu>
21 47.7 ( 15.7/ 28.2/ 22.2) I-hate-cyber-promo@man.ac.uk
19 33.2 ( 12.6/ 20.6/ 16.8) Nathan V. Patwardhan <nvp@shore.net>
18 26.5 ( 12.5/ 12.6/ 6.5) Russ Allbery <rra@stanford.edu>
18 37.4 ( 12.8/ 24.5/ 17.1) Douglas Seay <seay@absyss.fr>
14 24.0 ( 9.5/ 12.5/ 7.5) brian d foy <comdog@computerdog.com>
14 30.1 ( 10.7/ 16.8/ 14.1) Tom Christiansen <tchrist@mox.perl.com>
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
80.1 ( 23.8/ 56.3/ 31.2) 40 Tad McClellan <tadmc@flash.net>
67.9 ( 35.9/ 31.9/ 23.1) 45 Tom Phoenix <rootbeer@teleport.com>
47.7 ( 15.7/ 28.2/ 22.2) 21 I-hate-cyber-promo@man.ac.uk
41.0 ( 18.0/ 23.0/ 12.0) 26 Chipmunk <Ronald.J.Kimball@dartmouth.edu>
40.0 ( 15.5/ 24.5/ 10.9) 13 Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
39.6 ( 14.4/ 25.1/ 13.8) 25 David Alan Black <dblack@icarus.shu.edu>
37.4 ( 12.8/ 24.5/ 17.1) 18 Douglas Seay <seay@absyss.fr>
33.2 ( 12.6/ 20.6/ 16.8) 19 Nathan V. Patwardhan <nvp@shore.net>
30.1 ( 10.7/ 16.8/ 14.1) 14 Tom Christiansen <tchrist@mox.perl.com>
27.9 ( 5.8/ 20.2/ 14.9) 6 Paul Wilson <wilson@cs.utexas.edu>
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
71 Notice to antispammers
33 Perl auto-replier
32 RISC vs CISC or SunOS
25 pre-RFD: comp.lang.perl.{data-structure,inter-process,porters,regex}
25 Object IDs are good ( was: Object IDs are bad )
15 Object IDs are bad (was: Ousterhout and Tcl lost the plot with latest paper)
11 Network Programming and Sockets
10 [DRAFT] RFD: comp.lang.perl.{data-structure,inter-process,programmer,regex}
10 file copy
9 undump revisited?
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
163.4 ( 61.5/ 96.8/ 62.6) 71 Notice to antispammers
90.6 ( 55.7/ 33.5/ 19.8) 32 RISC vs CISC or SunOS
70.0 ( 27.0/ 41.5/ 27.8) 25 Object IDs are good ( was: Object IDs are bad )
59.1 ( 19.4/ 36.9/ 24.5) 25 pre-RFD: comp.lang.perl.{data-structure,inter-process,porters,regex}
58.2 ( 23.7/ 32.1/ 20.7) 33 Perl auto-replier
38.2 ( 16.3/ 20.9/ 15.4) 15 Object IDs are bad (was: Ousterhout and Tcl lost the plot with latest paper)
34.6 ( 10.1/ 23.6/ 17.4) 9 Ousterhout and Tcl lost the plot with latest paper
31.6 ( 7.9/ 23.6/ 16.5) 11 Network Programming and Sockets
24.8 ( 7.3/ 17.0/ 12.4) 10 [DRAFT] RFD: comp.lang.perl.{data-structure,inter-process,programmer,regex}
21.1 ( 6.5/ 14.1/ 9.8) 9 undump revisited?
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
103 comp.lang.c++
101 comp.lang.tcl
63 comp.lang.python
62 comp.lang.lisp
62 comp.lang.functional
62 comp.lang.eiffel
62 comp.lang.scheme
61 comp.lang.scheme.scsh
39 comp.unix.advocacy
37 comp.lang.javascript
Top 10 Crossposters
===================
Articles Address
-------- -------
49 Paul Wilson <wilson@cs.utexas.edu>
46 Roberto Dorich <dorich@ptc.com>
46 Kaz Kylheku <kaz@vision.crest.nt.com>
46 Greg Miller <uglmiller@cc.memphis.edu>
40 Patrick Doyle <doylep@ecf.toronto.edu>
36 "Eugene A. Pallat" <eapallat@orion-data.com>
35 Mark Bracey <mbracey@interaccess.com>
32 Andrew Koenig <ark@research.att.com>
32 Henry Baker <hbaker@netcom.com>
24 Chris Bitmead uid(x22068) <Chris.Bitmead@alcatel.com.au>
------------------------------
Date: 4 May 1997 09:46:11 GMT
From: k113973@cc.tut.fi (Kilpilinna Sami)
Subject: Substituting multiple lines
Message-Id: <5khlt3$l6m$1@cc.tut.fi>
Hello guys,
I have a small real life problem which many of you can solve
easily, I'm sure. I have a large number of HTML files and each
of them has, among other things, these four lines of code:
<CENTER><TABLE WIDTH=97%><TR><TD ALIGN=left>
<A HREF=../menu.html onMouseOver="window.status='Go to
menu'; return true"><IMG SRC=../../icons/menu.gif WIDTH=30
HEIGHT=30 BORDER=0></A>
</TD>
<TD ALIGN=right>
Now, I would like to cut out this part:
<TD ALIGN=left>
<A HREF=../menu.html onMouseOver="window.status='Go to menu'; return true"><IMG SRC=../../icons/menu.gif WIDTH=30 HEIGHT=30 BORDER=0></A>
</TD>
Which means that these things remain:
<CENTER><TABLE WIDTH=97%><TR>
<TD ALIGN=right>
So, how to do this with Perl (5.x)? I'd know how to remove
code from one line (Something like perl -pi -e
's/whatever//g;' *html) but it doesn't handle multiple
lines.
Oh, and if anyone knows a program for PC which does this
kind of things, let me know.
Thanks,
Sami
------------------------------
Date: Mon, 5 May 1997 07:02:39 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Substituting multiple lines
Message-Id: <v8ikk5.111.ln@localhost>
Kilpilinna Sami (k113973@cc.tut.fi) wrote:
: Hello guys,
: I have a small real life problem which many of you can solve
: easily, I'm sure. I have a large number of HTML files and each
: of them has, among other things, these four lines of code:
: <CENTER><TABLE WIDTH=97%><TR><TD ALIGN=left>
: <A HREF=../menu.html onMouseOver="window.status='Go to
: menu'; return true"><IMG SRC=../../icons/menu.gif WIDTH=30
: HEIGHT=30 BORDER=0></A>
: </TD>
: <TD ALIGN=right>
: Now, I would like to cut out this part:
: <TD ALIGN=left>
: <A HREF=../menu.html onMouseOver="window.status='Go to menu'; return true"><IMG SRC=../../icons/menu.gif WIDTH=30 HEIGHT=30 BORDER=0></A>
: </TD>
: Which means that these things remain:
: <CENTER><TABLE WIDTH=97%><TR>
: <TD ALIGN=right>
: So, how to do this with Perl (5.x)? I'd know how to remove
: code from one line (Something like perl -pi -e
: 's/whatever//g;' *html) but it doesn't handle multiple
: lines.
It does handle multiple lines. The problem is getting the multiple lines
into a variable to s///g against. The -p switch only gets you one line
at a time...
So, you could read the entire HTML file into a string, and then
apply the substitution:
$htmlfile = join '', <>; # or set: $/ = '';
$htmlfile =~ s#<TD.*?</TD>##s; # UNTESTED!
or as a one-liner:
perl -pi -0777 -e 's#<TD.*?</TD>##s' *.html
: Oh, and if anyone knows a program for PC which does this
: kind of things, let me know.
: Thanks,
: Sami
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Mon, 05 May 1997 11:01:48 +0100
From: Douglas Seay <seay@absyss.fr>
To: Tim Simms <tsimms@intr.net>
Subject: Re: Urgent help needed! State abbreviation conversion
Message-Id: <336DB00C.4BFD4FAF@absyss.fr>
[posted and mailed]
Tim Simms wrote:
> All I really need is a list of the 50 states and
> their abbreviations, and I'll make an associative array, but the point is
> I don't know the abbreviations and I don't want to have to type in the
> whole 50 states! Perhaps someone has already done this or knows where
> such a list exists?
This is one of the most off-topic posts I've ever seen. At least all
the TCL vs. Lisp posts were computer based.
> And if someone does help, I'll promise to start reading this list
> semi-regularly and helping others!
Please do. Welcome to the club. But try to stick to Perl questions.
- doug
------------------------------
Date: Mon, 05 May 1997 15:05:09 -0400
From: Scott Blanksteen <sib@worldnet.att.net>
Subject: Re: Urgent help needed! State abbreviation conversion
Message-Id: <336E2F65.B6E9BE4D@worldnet.att.net>
Tim Simms wrote:
> I apologize for only coming to the list when I need something, but could
> someone please point me to some source of State name conversion to the
> state 2 letter abbreviation? It doesn't matter which way, but it would be
> best to go both ways. All I really need is a list of the 50 states and
> their abbreviations, and I'll make an associative array, but the point is
> I don't know the abbreviations and I don't want to have to type in the
> whole 50 states! Perhaps someone has already done this or knows where
> such a list exists?
Tim -
This really isn't a Perl question, but you might try the U. S.
Postal Service web site:
http://www.usps.gov/
Scott
------------------------------
Date: 4 May 1997 20:00:37 GMT
From: brdavis@orion.ac.hmc.edu (Brooks Davis)
Subject: Re: Who Are You?
Message-Id: <5kipt5$716$2@cinenews.claremont.edu>
Cristo (cristo@consotech.se) wrote:
: Im making a shopping system for a company.
: The idea is that the customers will be able to order T-shirts over the
: net.
:
: I need something to recognize each and every user. It has to be unique.
: I am using their IP-adress now.
1) This isn't a Perl question so it doesn't really belong here.
2) However, if you look at the URL below you will find a compleatly free
catalog and shoping cart system written entierly in Perl.
http://www.minivend.com/minivend/
-- Brooks
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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 435
*************************************