[18527] in Perl-Users-Digest
Perl-Users Digest, Issue: 695 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 13 18:06:17 2001
Date: Fri, 13 Apr 2001 15:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <987199509-v10-i695@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 13 Apr 2001 Volume: 10 Number: 695
Today's topics:
[OT] Posts like this <diab.lito@usa.net>
Beta Testers/Perl Hackers <jamesfreeman@MailAndNews.com>
Re: Beta Testers/Perl Hackers (Abigail)
RE: Beta Testers/Perl Hackers <jamesfreeman@MailAndNews.com>
Re: Debugging Perl CGI scripts, was Re: CGI Problem <comdog@panix.com>
Re: File Upload (Anno Siegel)
Re: howto access serial devices in Perl? / "minicom" li <ciechowski@cis-computer.com>
Including common code as text in many scripts <postmaster@hollandnumerics.co.uk>
Re: Including common code as text in many scripts <ciechowski@cis-computer.com>
Re: Including common code as text in many scripts <elijah@workspot.net>
Re: Including common code as text in many scripts <comdog@panix.com>
Re: inheritance within one file? (Mark Jason Dominus)
Re: inheritance within one file? <uri@sysarch.com>
Re: Looking for a tutorial on connecting to a database (Mark Jason Dominus)
Re: Newbie hash vs files database?? (Garry Williams)
Newbie trends over time <jbc@west.net>
Re: Newbie trends over time <newspost@coppit.org>
Re: Newbie trends over time (Eric Bohlman)
Perl Bin and Visual Basic (tweaked)
Problem With Win32:FileSecurity Get/Set Methods <george.kuetemeyer@mail.tju.edu>
RE: RegEx novice <jamesfreeman@MailAndNews.com>
Re: Thankyou All Most Kindly :-) <comdog@panix.com>
Re: Thankyou All Most Kindly :-) (Alan Barclay)
to get a PId <guillaume.3@free.fr>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 13 Apr 2001 20:56:42 GMT
From: "Mario Rizzuti" <diab.lito@usa.net>
Subject: [OT] Posts like this
Message-Id: <eKJB6.8309$s93.506121@news.infostrada.it>
I am writing a bulletin board system as an hobby and having some doubts
developing a "view posts like this" feature.
The first methods coming to my mind are based on inverted indexes and sound
very slow and disk space wasters.
The basic idea is to have an hash table with all the words used and their
overall frequency in the forum posts.The less frequent words would be
considered more descriptive and then given an higher score while sorting the
results.
Or even having an array with a constant $x number of words sorted by this
score and look just for them.
At this point the script would track the user click on the results page and
find the words in the "descriptive array" that are not present in the post
and increase their frequency by $k (to give them less "descriptive score").
Can anyone advice me about an effective way to develop this feature?
Thanks,
Mario Rizzuti
------------------------------
Date: Fri, 13 Apr 2001 15:16:11 -0400
From: james freeman <jamesfreeman@MailAndNews.com>
Subject: Beta Testers/Perl Hackers
Message-Id: <3AF7AF09@MailAndNews.com>
Hi all
If you hack perl you may be interested in checking out some new beta
scripts
and I would certainly appreciate your comments so they can be optimised.
These scripts are designed to provide a set of useful tools to help in the
generation of good clean production perl code. All scripts have pod, use
strict and warnings and have been sucessfully tested on a range of code over
the last year.
There are five editor scripts to help with your everyday perl coding:
fixindent.pl
This thousand line script will process a script (writing a backup of course)
and fix the indentation according to your stylistic preferences. A fairly
complete set of configuration options are available. All the recognised
indentation styles are supported and you can easily convert back and forth
between them.
whitespace.pl
This script works with fixindent.pl and will fix a wide range of whitespace
problems from no space around operators, to useless trailing whitespace to
name just two. You may also optionally stip out excess blank lines.
stripcomments.pl
This script will accurately find and strip all comments and pod from your
code
producing shorter, faster loading, and faster comiling code. Yes it is less
readable and maintainable to. Optionally it will also crunch a script down
by
removing newlines to give a user selected line length making the code very
difficult for others to read/modify/borrow/maintain ... no problem for perl
though ;)
showcomments.pl and show print.pl
These two scripts will show all the comments/print statements in a script
allowing you to cull commented out code and debugging print statements
quickly
and thoroughly when producing production grade code. The comment finding
algoritm is the same one use to strip comments and won't waste your time
finding non comments like:
#foo#bar#; # sub foo with bar
#myarray) { # loop through @myarray
#\$%\^`/_/g; # substitute _ for shell chars
The scripts and pod are online at:
http://www.dynamicflight.com.au/perl.htm
Cheers
James
------------------------------
Date: Fri, 13 Apr 2001 20:28:17 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Beta Testers/Perl Hackers
Message-Id: <slrn9deob1.aee.abigail@tsathoggua.rlyeh.net>
james freeman (jamesfreeman@MailAndNews.com) wrote on MMDCCLXXXII
September MCMXCIII in <URL:news:3AF7AF09@MailAndNews.com>:
__
__ stripcomments.pl
__
__ This script will accurately find and strip all comments and pod from your
__ code
__ producing shorter, faster loading, and faster comiling code. Yes it is less
__ readable and maintainable to. Optionally it will also crunch a script down
__ by
__ removing newlines to give a user selected line length making the code very
__ difficult for others to read/modify/borrow/maintain ... no problem for perl
__ though ;)
Note that it produces something that cannot be run anymore.
Just for laughs, I downloaded stripcomments.pl. I added a shebang line
and applied it on itself, then repeating the process:
$ ./stripcomments.pl ./stripcomments.pl
Processing
Done! Comment stripped file ./stripcomments.pl
Backup of original ./stripcomments.pl.bak
$ ./stripcomments.pl ./stripcomments.pl
./stripcomments.pl: use: command not found
: command not found
./stripcomments.pl: use: command not found
: command not found
./stripcomments.pl: my: command not found
: command not found
./stripcomments.pl: my: command not found
: command not found
./stripcomments.pl: my: command not found
: command not found
./stripcomments.pl: my: command not found
: command not found
./stripcomments.pl: my: command not found
: command not found
./stripcomments.pl: my: command not found
: command not found
./stripcomments.pl: line 12: syntax error near unexpected token `shift(@'
'/stripcomments.pl: line 12: `my $path = shift(@ARGV) || '';
$
Oops! I guess you failed to understand the meaning of the shebang line!
And it didn't take me more than a minute to come with with another breakage:
$ cat test
$_=<<'=pod';
Just another Perl Hacker
=pod
print;
$ perl test
Just another Perl Hacker
$ ./stripcomments.pl test
Processing
Done! Comment stripped file ./test
Backup of original ./test.bak
$ perl test
Can't find string terminator "=pod" anywhere before EOF at test line 2.
$ cat test
# Stripped by stripcomments.pl (c) Dr James Freeman jfreeman@tassie.net.au
$_=<<'=pod';
Just another Perl Hacker
$
Neato. Lost part of the program.
Another example:
$ cat test2
$_ = "Just another Python# Hacker\n";
s {Python#}
[Perl];
print;
$ perl test2
Just another Perl Hacker
$ ./stripcomments.pl test2
Processing
Done! Comment stripped file ./test2
Backup of original ./test2.bak
$ perl test2
Substitution pattern not terminated at test2 line 3.
$ cat test2
# Stripped by stripcomments.pl (c) Dr James Freeman jfreeman@tassie.net.au
$_ = "Just another Python# Hacker\n";
s {Python
[Perl];
print;
$
Brilliant!
Remember kids, unless your name is Damian or Ilya, leave parsing Perl to perl.
Abigail
------------------------------
Date: Fri, 13 Apr 2001 17:46:17 -0400
From: james freeman <jamesfreeman@MailAndNews.com>
Subject: RE: Beta Testers/Perl Hackers
Message-Id: <3AF96DC0@MailAndNews.com>
Hi Abigail
Can you please send me the output after running stripcomments.pl on itself.
When I run it on a dos box I get no problems, vis:
C:\>perl stripcomments.pl stripcomments.pl
Processing
Done! Comment stripped file ./stripcomments.pl
Backup of original ./stripcomments.pl.bak
C:\>perl stripcomments.pl stripcomments.pl
The target backup file ./stripcomments.pl.bak exists, overwrite (Y/N)? y
Processing
Done! Comment stripped file ./stripcomments.pl
Backup of original ./stripcomments.pl.bak
C:\>perl stripcomments.pl stripcomments.pl
The target backup file ./stripcomments.pl.bak exists, overwrite (Y/N)? y
Processing
Done! Comment stripped file ./stripcomments.pl
Backup of original ./stripcomments.pl.bak
C:\>
You are quite correct that it will break this:
$_ = "Just another Python# Hacker\n";
s {Python#}
[Perl];
print;
This is because the regex finding algorithm only looks for single line
regexes
(a function of its current design) It has no problem with:
$_ = "Just another Python# Hacker\n";
s {Python#}[Perl];
print;
I have not previously seen anyone use =pod as a herepage token but can catch
such tokens with ease. I made a rash presumption that most people use lines
starting with = in pod context only! TIMTWOTDI.
Thanks for the invaluable feedback, as noted this stuff works well on my
style
of scripting (and a number ot other peoples) but needs testing on a wider
variety of styles.
If you could email me the output that you have after one pass of
stripcomments.pl on itself that would be great as it works just fine under
DOS.
Why it should be any different under unix???? I'll run it on my linux box
today and see if I get the same results.
Cheers
James
>===== Original Message From abigail@foad.org =====
>james freeman (jamesfreeman@MailAndNews.com) wrote on MMDCCLXXXII
>September MCMXCIII in <URL:news:3AF7AF09@MailAndNews.com>:
>__
>__ stripcomments.pl
>__
>__ This script will accurately find and strip all comments and pod from your
>__ code
>__ producing shorter, faster loading, and faster comiling code. Yes it is
less
>__ readable and maintainable to. Optionally it will also crunch a script down
>__ by
>__ removing newlines to give a user selected line length making the code very
>__ difficult for others to read/modify/borrow/maintain ... no problem for
perl
>__ though ;)
>
>Note that it produces something that cannot be run anymore.
>
>Just for laughs, I downloaded stripcomments.pl. I added a shebang line
>and applied it on itself, then repeating the process:
>
> $ ./stripcomments.pl ./stripcomments.pl
> Processing
> Done! Comment stripped file ./stripcomments.pl
> Backup of original ./stripcomments.pl.bak
> $ ./stripcomments.pl ./stripcomments.pl
> ./stripcomments.pl: use: command not found
> : command not found
> ./stripcomments.pl: use: command not found
> : command not found
> ./stripcomments.pl: my: command not found
> : command not found
> ./stripcomments.pl: my: command not found
> : command not found
> ./stripcomments.pl: my: command not found
> : command not found
> ./stripcomments.pl: my: command not found
> : command not found
> ./stripcomments.pl: my: command not found
> : command not found
> ./stripcomments.pl: my: command not found
> : command not found
> ./stripcomments.pl: line 12: syntax error near unexpected token `shift(@'
> '/stripcomments.pl: line 12: `my $path = shift(@ARGV) || '';
> $
>
>
>Oops! I guess you failed to understand the meaning of the shebang line!
>
>
>And it didn't take me more than a minute to come with with another breakage:
>
> $ cat test
> $_=<<'=pod';
> Just another Perl Hacker
> =pod
> print;
> $ perl test
> Just another Perl Hacker
> $ ./stripcomments.pl test
> Processing
> Done! Comment stripped file ./test
> Backup of original ./test.bak
> $ perl test
> Can't find string terminator "=pod" anywhere before EOF at test line 2.
> $ cat test
> # Stripped by stripcomments.pl (c) Dr James Freeman
jfreeman@tassie.net.au
> $_=<<'=pod';
> Just another Perl Hacker
> $
>
>
>Neato. Lost part of the program.
>
>Another example:
>
> $ cat test2
> $_ = "Just another Python# Hacker\n";
> s {Python#}
> [Perl];
> print;
> $ perl test2
> Just another Perl Hacker
> $ ./stripcomments.pl test2
> Processing
> Done! Comment stripped file ./test2
> Backup of original ./test2.bak
> $ perl test2
> Substitution pattern not terminated at test2 line 3.
> $ cat test2
> # Stripped by stripcomments.pl (c) Dr James Freeman
jfreeman@tassie.net.au
> $_ = "Just another Python# Hacker\n";
> s {Python
> [Perl];
> print;
> $
>
>
>Brilliant!
>
>
>Remember kids, unless your name is Damian or Ilya, leave parsing Perl to
perl.
>
>
>Abigail
------------------------------
Date: Fri, 13 Apr 2001 15:00:09 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Debugging Perl CGI scripts, was Re: CGI Problem
Message-Id: <comdog-D8C438.15000913042001@news.panix.com>
In article
<Pine.LNX.4.30.0104131505580.16315-100000@lxplus003.cern.ch>, "Alan J.
Flavell" <flavell@mail.cern.ch> wrote:
> A good starting point is
> http://www.smithrenaud.com/public/CGI_MetaFAQ.html
> The "idiot's guide" linked from there can serve as a useful checklist
> for the more crass CGI errors.
there is in fact two troubleshooting guides there. if you can't
isolate the problem with either, then a post to usenet explaining
why those didn't work could be good. note: the troubleshooting
guides also help you formulate your question :)
--
brian d foy <comdog@panix.com>
------------------------------
Date: 13 Apr 2001 18:14:34 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: File Upload
Message-Id: <9b7fma$l8j$1@mamenchi.zrz.TU-Berlin.DE>
According to Uri Guttman <uri@sysarch.com>:
> >>>>> "RS" == Ron Savage <ron@savage.net.au> writes:
>
> RS> Keep an eye on this page: http://savage.net.au/Perl-tutorials.html
> RS> I'll try to upload a 'File upload' tutorial sometime in the next few days.
>
> why do you call those tutorials when there is no explanatory text?
>
> i just decided to look at one of them to see what you are doing. i did
> not like what i saw.
[...]
I pulled another random example and I concur. The page itself is
a pain to read; my browser shows mile-long lines that don't adapt
to the window width. You get a list of downloadable tarballs, called
tutorials. The one I pulled is an uncommented bit of code which turns
out to be a script that sends a fixed email message with a more-or-less
fixed from-header to someone choseable. The coding style is peculiar,
with a tendency to hide the important action in a nest of error catching
routines.
Oh, there is *one* comment: the last three lines of code are
# Success.
print "Success \n";
exit(0);
I rest my case. It's not a tutorial. It's a script archive, and it
doesn't look good.
Anno
------------------------------
Date: Fri, 13 Apr 2001 20:07:35 +0200
From: Ingo Ciechowski <ciechowski@cis-computer.com>
Subject: Re: howto access serial devices in Perl? / "minicom" light
Message-Id: <01HW.B6FD0D07005CA5411A6620F0@News.CIS.DFN.DE>
On Fri, 13 Apr 2001 19:31:09 +0200, Simon Flack wrote
(in message <9b7dca$82v1i$1@ID-83895.news.dfncis.de>):
> http://search.cpan.org/search?mode=module&query=serialport
Great. This worked for /dev/modem - but for some reason I don't get it to
work for /dev/ttyI0 which is my isdn card :-(
(effect: the tool does not come back from Device::SerialPort->start() and if
I terminate the program using ctrl-C I'm receiving a segmentation fault)
any idea?
--
Ingo
ciechowski@cis-computer.com
------------------------------
Date: Fri, 13 Apr 2001 21:37:16 +0100
From: Phil Holland <postmaster@hollandnumerics.co.uk>
Subject: Including common code as text in many scripts
Message-Id: <GEgdtCA8N216Ew5C@hollandnumerics.demon.co.uk>
I have a number of similar Perl5 scripts where about 80% of the code is
common to all of them. The code includes a large number of variables
that are globally scoped to cover all of each script, so my attempts to
use 'require' have failed with undefined variable error in the included
code (which, by chance, is made up of a collection of subroutines that
use some of these global variables).
What I would like to be able to do is put all the common code in a
separate text file, but include the text in all of my scripts prior to
compilation. This would reduce my maintenance effort by at least 80%!!
Can anyone help please?
.........Phil Holland
--
--------------------------------------------------------
Holland Numerics Ltd
94 Green Drift, Royston, Herts SG8 5BT, UK
mobile : +44-(0)7714-279085
email : <NEWS@hollandnumerics.com>
URL : http://www.hollandnumerics.com/
--------------------------------------------------------
------------------------------
Date: Fri, 13 Apr 2001 22:58:36 +0200
From: Ingo Ciechowski <ciechowski@cis-computer.com>
Subject: Re: Including common code as text in many scripts
Message-Id: <01HW.B6FD351C006610451A6620F0@News.CIS.DFN.DE>
> What I would like to be able to do is put all the common code in a
> separate text file, but include the text in all of my scripts prior to
> compilation. This would reduce my maintenance effort by at least 80%!!
if you put you common code into a file "common.pm" this can be included by
the phrase "use common;" from any other file in the same directory
--
Ingo
ciechowski@cis-computer.com
------------------------------
Date: 13 Apr 2001 21:05:26 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Including common code as text in many scripts
Message-Id: <eli$0104131704@qz.little-neck.ny.us>
In comp.lang.perl.misc, Ingo Ciechowski <ciechowski@cis-computer.com> wrote:
> > What I would like to be able to do is put all the common code in a
> > separate text file, but include the text in all of my scripts prior to
> > compilation. This would reduce my maintenance effort by at least 80%!!
> if you put you common code into a file "common.pm" this can be included by
> the phrase "use common;" from any other file in the same directory
If he couldn't get it to work with 'require', then 'use' isn't going to
be much better.
Perhaps a 'do "file";' would help?
Elijah
------
rewriting so that 'use' or 'require' works might be good, too
------------------------------
Date: Fri, 13 Apr 2001 17:58:29 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Including common code as text in many scripts
Message-Id: <comdog-9F3E45.17582913042001@news.panix.com>
In article <GEgdtCA8N216Ew5C@hollandnumerics.demon.co.uk>, Phil Holland
<postmaster@hollandnumerics.co.uk> wrote:
> I have a number of similar Perl5 scripts where about 80% of the code is
> common to all of them. The code includes a large number of variables
> that are globally scoped to cover all of each script, so my attempts to
> use 'require' have failed with undefined variable error in the included
> code (which, by chance, is made up of a collection of subroutines that
> use some of these global variables).
can you show us a small example of what you are doing? you are on
the right track but maybe missed a detail.
> What I would like to be able to do is put all the common code in a
> separate text file, but include the text in all of my scripts prior to
> compilation. This would reduce my maintenance effort by at least 80%!!
absolutely. when you talk to people about this, heavy use of
the word "refactoring" will make you sound like a programming
guru :)
--
brian d foy <comdog@panix.com>
------------------------------
Date: Fri, 13 Apr 2001 19:14:55 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: inheritance within one file?
Message-Id: <3ad7502f.4348$2bb@news.op.net>
In article <x71yqxo1vs.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
> >> if you put up a cpan module with internal class names that aren't
> >> below the file's name, i would hope they would disallow it.
>
> MJD> Nope. They don't disallow anything. You can put porno pictures in
> MJD> your CPAN directory if you want to.
>
>in your directory, sure. but try to upload a version of something that
>has an established name like Net::*.
OK, I did.
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/MJD/Net-Ping-0.02.tar.gz
Net::Ping 0.02 should be available world-wide within 48 hours.
>see this page:
>
>http://www.cpan.org/modules/04pause.html#namespace
See this page:
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/MJD/Net-Ping-0.02.readme
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Fri, 13 Apr 2001 21:02:55 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: inheritance within one file?
Message-Id: <x766g8ms1u.fsf@home.sysarch.com>
>>>>> "MJD" == Mark Jason Dominus <mjd@plover.com> writes:
>> in your directory, sure. but try to upload a version of something that
>> has an established name like Net::*.
MJD> ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/MJD/Net-Ping-0.02.tar.gz
^^^^^^^^^^^^^^
in your directory. net::Ping is not even in the
modules/by-category/05_Networking_Devices_IPC/Net/ directory since it is
bundled with perl.
try it with an established name and see if the folks are
modules@cpan.prg let you get away with it. it is breaking the (loose)
rules to do that.
i am done with this thread. upload whatever you want to cpan.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info: http://www.sysarch.com/perl/OOP_class.html
------------------------------
Date: Fri, 13 Apr 2001 19:16:57 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Looking for a tutorial on connecting to a database with Perl
Message-Id: <3ad750a8.4359$3df@news.op.net>
In article <tddqs2mves2me4@corp.supernews.co.uk>,
Si@lineone <simon-carlisle@*REMOVEME*lineone.net> wrote:
>Hello
>Im looking for a good tutorial on using Perl to connect to a database
>
>Id be grateful if someone could post a url.
http://www.perl.com/pub/1999/10/DBI.html
>Best Regards
Likewise.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Fri, 13 Apr 2001 18:12:47 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Newbie hash vs files database??
Message-Id: <slrn9degcv.4q3.garry@zfw.zvolve.net>
On Wed, 11 Apr 2001 02:53:03 -0400, Jason Goodrow <@opencity.com> wrote:
> I got involved with a really large database - lots of entries of 20
> variable length fields.
> When the fields were static I was using a flat file and seeking the
> records but now they're going to change so updates
> get complicated.
>
> I'm thinking of using hashes - one for each entry. I would then have a
> directory with
> 10k of hashes. Or seperate text files that I split for the fields and a
> directory with 10k text files.
>
> Am I abusing the unix directory structure with this many entries?
> These entries will mostly just sit there with flurries of activity so is
> either strategy easier
> on the CPU?
If you're going to use a hash, make it a tie'd hash. See the
NDBM_File or DB_File manual page.
--
Garry Williams
------------------------------
Date: Fri, 13 Apr 2001 12:29:17 -0700
From: John Callender <jbc@west.net>
Subject: Newbie trends over time
Message-Id: <3AD7538D.B5F3DC0@west.net>
It's always dangerous to reason from too few data, but there are
times when the perspective of an outsider can be helpful. I've
been on a self-imposed sabbatical from c.l.p.m. for a year or
more, and have never really been any kind of regular, except in
the lurker sense. But I recently finished up a project that had
been consuming much of my spare time, and thought to myself, hey,
I wonder what's going on in clpm? So I popped back in for a
look-see.
Maybe I'm just catching the group on a bad week, but it seems
pretty clear that the problem with newbies blundering in and
posting off-topic (typically Web/CGI related) questions has
gotten worse. Beyond that, though, I notice something else: The
"cure" provided by those who believe the appropriate response is
to show misbehaving newbies rudely toward the exits is more in
evidence than ever, while the incidence of those who politely
(tirelessly, thanklessly, yes, I know) try to offer some help
along with pointers on how the recipient might participate more
appropriately in the future seems to be going down.
As I say, I may be mischaracterizing the state of the group based
on too few data, but I think that trend, to the extent it's real,
is worth thinking about. And I think it's worth thinking about on
a deeper level than is typical of the "They deserve to be
flamed!" "No they don't!" argument that is the normal outcome of
the question being raised.
Stipulated: Off-topic posting, whether it is the result of
stupidity, ignorance, or malicious trolling, sucks. It has
degraded, and is continuing to degrade, the usefulness of the
group. The people who engage in it should be stopped from doing
so.
That said, the following also needs to be recognized: The
flame-them-into-silence approach isn't working. From my
(admittedly sketchy) sample, the incidence of off-topic posts is
increasing, not decreasing. Worse, the poisonous atmosphere
created by the rudeness seems to be driving away (or driving into
silence, or maybe just drowning out by sheer volume) the truly
helpful responses that (for this newbie, at least), played such a
big role in my own learning of Perl.
More than once I've seen someone who is stridently anti-newbie
invoke the departure of Larry Wall from the group as an example
of the evils of the newbie influx. I'm sure that's true as far as
it goes, although (sadly, for me) my own experience doesn't reach
back that far. But I think it might be a bit more complex than
some of those who make that claim are admitting.
From what I've seen of Larry (not much, it's true), he seems
relatively unbothered by the merely ignorant. I suppose that's a
good thing, since from his perspective virtually everyone he
comes into contact with is ignorant to some degree or another, at
least with respect to Perl. Indeed, in terms of the personal
philosophy he manifests in his writings, and in the design
decisions that went into Perl, he seems to be positioned fairly
dramatically at the tolerant, live-and-let-live,
strive-to-be-a-humble-servant-to-all end of the spectrum.
What he does seem to have a profound distaste for, if I can be so
bold as to offer observations like this about someone I've never
met, is rudeness, and hostility, and vindictiveness. Rigidity and
inflexibility. My way or the highway. Just One Way to Do It. And
so on.
Anyway, I'm not sure how relevant this is, since he's not here
anymore, and several score newly minted newbies per week are. But
for those who have striven, and who continue to strive, to live
up to his example in how they treat the lowest among the group's
participants, you have my heartfelt thanks. And for those who say
they'd like to restore the civility and cohesiveness that this
group used to have, but who seem to think they can achieve that
by nuking the newbies back to the Stone Age, I encourage you to
try to think up something better.
Thanks.
John
------------------------------
Date: Fri, 13 Apr 2001 16:18:15 -0400
From: David Coppit <newspost@coppit.org>
Subject: Re: Newbie trends over time
Message-Id: <Pine.SUN.4.33.0104131606170.5859-100000@mamba.cs.Virginia.EDU>
On Fri, 13 Apr 2001, John Callender wrote:
> And for those who say they'd like to restore the civility and
> cohesiveness that this group used to have, but who seem to think
> they can achieve that by nuking the newbies back to the Stone Age, I
> encourage you to try to think up something better.
Here here.
I stopped reading clpm because the s/n ration was too low. This
included the newbie posts, but it also included content-free replies
by arrogant non-newbies, and the eventual exchange that ensued. (The
non-newbies seem to forget that each off topic post generally comes
from a *new* newbie, and therefore doesn't deserve whatever
frustration which may have accumulated from the *previous* newbies.)
So... here's a proposal:
- Post the FAQ for this newsgroup frequently, and make sure that one
of the first entries is "Is this the right place to ask about X?"
Note that I'm not talking about the FAQ for Perl, but rather a FAQ
which explains proper content and etiquette for the newsgroup, and
which points the user to the Perl FAQ.
- Agree to make the standard response to all off-topic posts simply a
link to the newsgroup FAQ. No flames, no self-important denigration
of others. And if anyone actually has the urge to reply, they move
the conversation to the proper newsgroup.
Thoughts?
David
------------------------------
Date: 13 Apr 2001 21:32:56 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Newbie trends over time
Message-Id: <9b7ra8$mrv$1@bob.news.rcn.net>
David Coppit <newspost@coppit.org> wrote:
> On Fri, 13 Apr 2001, John Callender wrote:
>> And for those who say they'd like to restore the civility and
>> cohesiveness that this group used to have, but who seem to think
>> they can achieve that by nuking the newbies back to the Stone Age, I
>> encourage you to try to think up something better.
> Here here.
> I stopped reading clpm because the s/n ration was too low. This
> included the newbie posts, but it also included content-free replies
> by arrogant non-newbies, and the eventual exchange that ensued. (The
> non-newbies seem to forget that each off topic post generally comes
> from a *new* newbie, and therefore doesn't deserve whatever
> frustration which may have accumulated from the *previous* newbies.)
I have seen *very* few intemperate responses posted to a newbie's *first*
foray into this group, regardless of how off-topic the question was. In
those very few cases, the initial posts usually seemed worded to pick a
fight, or contained a great deal of rudeness itself (e.g. essentially
asking people to write a program for them, often with the implication that
the poster was going to charge a client for it, or asking people to reply
via e-mail because the poster "doesn't read this group"--this is even
ruder when the poster expects the responders to remove the spamblock from
his address as well). Once again, I've seen this happen *very* few times.
What I've seen happen much more often is that a newbie posts a FAQ or
off-topic question, a regular curly but politely points the questioner to
the appropriate FAQ document or an on-topic group, and the original poster
responds with an insult because he's so thin-skinned that he regards a
factual, non-judgmental statement that he made a mistake to be a personal
attack that he must defend against. *That* kind of response frequently
gets an intemperate reply, largely because it's an expression of a
condescending and selfish attitude. This group is not a help desk. As
Randal says, it's a potluck. It is *not* rude to tell someone not to
bogart the potato salad. It *is* rude to respond with "who appointed you
god?" to a request not to bogart the potato salad. When that happens in a
crowd, tempers are going to fly.
Now all the experts in assertiveness training and cognitive-behavioral
therapy will tell you that yelling at people almost never changes their
behavior in a positive way, and that if someone is trying to pick a fight
with you, you're giving them just what they want if you lose your cool.
So in general, the best response to provocation is either to ignore it or
respond in a cool, "broken record," fashion. One problem here is that
often a provocative response is accompanied by a superstitious statement
(or piece of code) that really needs to be corrected. But it's still
possible to be polite while indicating to others that the statement or
code is not a Good Example to be followed.
------------------------------
Date: Fri, 13 Apr 2001 18:43:49 GMT
From: tunneling_news@hotmail.com (tweaked)
Subject: Perl Bin and Visual Basic
Message-Id: <3ad764df.10601573@news>
MY OBJECTIVE:
I want to provide a slim version of Perl with an install of my VB app
so I can execute Perl scripts from my Visual Basic Application.
REASON:
I'm well seasoned in using Perl for text manipulation.
QUESTION:
I know all the VB shell stuff and I can run scripts on my PC but I get
kinda foggy when I begin looking in the Perl Bin for what I should
include with the install of my VB app. I know that many ECAD tools
make extensive use of Perl, by including it with the application. Does
anyone have experience with this that they wouldn't mind sharing or
know of a reference?
Regards,
Troll
http://www.gimptroll.com
------------------------------
Date: Fri, 13 Apr 2001 15:58:39 -0400
From: "George M. Kuetemeyer" <george.kuetemeyer@mail.tju.edu>
Subject: Problem With Win32:FileSecurity Get/Set Methods
Message-Id: <3AD75A6E.436E91C8@mail.tju.edu>
I'm having problems with the ActivePerl 5.6.0 distribution's
Win32::FileSecurity module (version 1.04) that I didn't have with the
version contained in ActivePerl 5.22 (version 1.03). I'm trying to set
ACL's in such a way that the current set of permissions on the
directory/file are carried over, with only a single account's ACL's
being changed. Here's a sample of the code I'm using:
use Win32::FileSecurity qw( Get Set MakeMask );
my $directory_path = 'd:/users/testacct';
my $account = 'testacct';
my %perm_hash;
# get current directory ACL info in account/perms hash
Get($directory_path,\%perm_hash);
# set up new ACL for specific account
$perm_hash($account) = MakeMask( qw( FULL GENERIC_ALL ));
# apply ACL's
$result = Set($directory_path, \%perm_hash);
print "$result\n";
Running the script results in the following error which aborts the
script:
TEST-PDC\testacct
Error handling error: 1722, LookupAccountName at
D:\perl\site\scripts\test-security.pl line 11
If I start the script at the MakeMask line (thereby not capturing ALL of
the ACL info) everything works without error. I thought that perhaps I
wasn't specifying the account correctly, but all variants (with domain
info, without, formatted the same as the %perm_hash key values, etc.)
fail. The keys/values that result from the Get method appear to be
correct. It almost seems like the new version doesn't want to apply
ACL's for mutiple accounts.
Thanks in advance.
------------------------------
Date: Fri, 13 Apr 2001 16:39:38 -0400
From: james freeman <jamesfreeman@MailAndNews.com>
Subject: RE: RegEx novice
Message-Id: <3AF8AFF9@MailAndNews.com>
>===== Original Message From "dkh" <projectobjects@earthlink.net> =====
>How would I go about building a regular expression that would exclude one
>phrase from the other, like so:
>
>1. <word>[_- ]<word>
>2. <word>[_- ]<word>[_- ]<word>
>
>so that 1 would be excluded even though it is part of 2.
>
>thanks for any replies,
>dale
>
Although what you are asking for is not entirely clear lookaround assertions
will probably do what you want. Probably easier to show by example. Note two
things:
1) A lookaround assertion does not eat up any of the search string. It is
like
a sneak preview of what is to come, or what just came. Technically it does
actually eat up the string but it gives it so the effect is as described.
2) While you can use varible length wildcard modifiers ie * + {2,3} in a
lookahead assertion you can only use fixed length search strings in a
lookbehind assertion.
The positive lookahead assertion (?=what must follow next)
m/foo(?=foo)/
will match "foofoo" and "foofoofoo", but not "foobar", "foo", "fooyou"
The negative lookahead assertion (?!=what must not follow next)
m/foo(?!=foo)/
will match "foobar", "foo", "fooyou" and also the second foo in "foofoo"
You can also use look behind assertions
The positive lookback asseertion (?<=what must occur before)
m/(?<=foo)foo/
will match "foofoo" and "foofoofoo", but not "foobar", "foo", "fooyou"
The negative lookback assertion (?<!what must not occur before)
m/(?<!foo)foo/
will match "foo", "fooyou", "foobar" and also, perhaps surprisingly "foofoo"
as there is a valid match of the first foo.
To match foofoo but not foofoofoo you can use this
m/(?<!foo)foofoo(?!=foo)/
This expression will only match foofoo if there are no other foos in the
immediate vicinity!
Hope this helps. Full details in the camel book
Doc
------------------------------
Date: Fri, 13 Apr 2001 14:56:35 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Thankyou All Most Kindly :-)
Message-Id: <comdog-1D255A.14563513042001@news.panix.com>
In article <987121014.22958.0.nnrp-08.c2ded7c2@news.demon.co.uk>, "Karl
Young" <karlyoung@unconscious.co.uk> wrote:
> Brian, Randall, Alan et al . Thankyou most kindly for your answers & for the
> comp.infosystems.www.authoring.cgi newsgroup.
you're welcome. we try ;)
--
brian d foy <comdog@panix.com>
------------------------------
Date: 13 Apr 2001 21:02:15 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: Thankyou All Most Kindly :-)
Message-Id: <987195730.408194@elaine.furryape.com>
In article <987121014.22958.0.nnrp-08.c2ded7c2@news.demon.co.uk>,
Karl Young <karlyoung@unconscious.co.uk> wrote:
>Does anyone really read a newsgroup for 3 weeks before posting to it?
Note that it doesn't actually have to take you 3 weeks to read 3
physical weeks of posts. With your news provider's archive you can
read back, often all 3 weeks, usually at least 2.
Deja when it was available, and google when it is available*, will
also let you catch up on the recent messages.
This means that it can often take you only a few minutes to read the
group and sometimes even find a FAQ or your answer directly - quicker
than asking the question, annoying the regulars, and waiting for an
answer.
------------------------------
Date: Fri, 13 Apr 2001 20:07:47 GMT
From: "guillaume" <guillaume.3@free.fr>
Subject: to get a PId
Message-Id: <n0JB6.257$lM6.357478@nnrp5.proxad.net>
hi,
how can i get the PId of any application? i didn't find a PERL function
to do that. (i don't speak of the PERL program's PId)
thank you
guillaume.3@free.fr
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 695
**************************************