[22924] in Perl-Users-Digest
Perl-Users Digest, Issue: 5144 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 27 06:05:50 2003
Date: Fri, 27 Jun 2003 03:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 27 Jun 2003 Volume: 10 Number: 5144
Today's topics:
Am I being boycotted? <goedicke@goedsole.com>
Re: Am I being boycotted? <tassilo.parseval@rwth-aachen.de>
Re: Am I being boycotted? <goedicke@goedsole.com>
Re: Am I being boycotted? (Jay Tilton)
Re: Am I being boycotted? (Malcolm Dew-Jones)
Re: Am I being boycotted? (Anno Siegel)
Anybody making Windows interfaces w/ Perl? <SeeMessageBody@nospam.com>
Re: Anybody making Windows interfaces w/ Perl? (Damian James)
Re: Anybody making Windows interfaces w/ Perl? <a@c.com>
Re: Database Connection Pooling in Perl CGI Script WITH (Bryan Castillo)
Hash::Utils lock_keys <johannes.fuernkranz@t-online.de>
How does @LAST_MATCH_START work? <Olof.KarlbergNOSPAMatebc.uu.se>
Re: How does @LAST_MATCH_START work? <nospam-abuse@ilyaz.org>
Re: Offer tips, comments on this code (generates html t <spamblock@junkmail.com>
Re: perlio problem? redhat 9, perl 5.8.0 (gordon)
Posting Guidelines for comp.lang.perl.misc ($Revision: tadmc@augustmail.com
Re: problem when use debug perl in win2000 os <heye@v2tech.com>
Using local $/ <abuse@sgrail.org>
Re: Using local $/ <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: Using local $/ (Anno Siegel)
Re: Using local $/ <abuse@sgrail.org>
Re: Using local $/ <johannes.fuernkranz@t-online.de>
Re: Using local $/ <abuse@sgrail.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 27 Jun 2003 05:36:11 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Am I being boycotted?
Message-Id: <m33chwjd4l.fsf@mail.goedsole.com>
Dear Y'all -
Sorry, for the personal nature of this post, but I've had no
response to my last dozen questions. Did I offend with poor
etiquette or are my questions just hard to answer?
Yours - Billy
============================================================
William Goedicke goedicke@goedsole.com
http://www.goedsole.com:8080
============================================================
Lest we forget:
War is caused by the squabling of princes.
- Machievelli
------------------------------
Date: 27 Jun 2003 05:43:36 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Am I being boycotted?
Message-Id: <bdgli8$ouf$1@nets3.rz.RWTH-Aachen.DE>
Also sprach William Goedicke:
> Sorry, for the personal nature of this post, but I've had no
> response to my last dozen questions.
I only see one question of yours among my not-yet-expired articles.
> Did I offend with poor etiquette or are my questions just hard to
> answer?
I don't think it's a boycott. Instead I guess no one had something
intelligent to say. It happens once in a while. You can go over your
unreplied articles once more and see whether you can rephrase them so
that replies are more likely.
Your last question was something above detecting cycles in a graph. We
had the graph-issue a couple of times here lately so perhaps the group
was a little fed up with this topic. :-)
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Fri, 27 Jun 2003 06:01:08 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: Am I being boycotted?
Message-Id: <m3of0khxek.fsf@mail.goedsole.com>
Dear Tassilo -
>>>>> "Tassilo" == Tassilo v Parseval <tassilo.parseval@rwth-aachen.de> writes:
Tassilo> I don't think it's a boycott. Instead I guess no one had
Tassilo> something intelligent to say.
That's a relief.
Tassilo> Your last question was something above detecting cycles
Tassilo> in a graph. We had the graph-issue a couple of times here
Tassilo> lately so perhaps the group was a little fed up with this
Tassilo> topic. :-)
Should I conclude that we haven't figured out how to recognize cycles?
Yours - Billy
============================================================
William Goedicke goedicke@goedsole.com
http://www.goedsole.com:8080
============================================================
Lest we forget:
Perl is orthogonal on hashes.
- William Goedicke
------------------------------
Date: Fri, 27 Jun 2003 06:14:11 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Am I being boycotted?
Message-Id: <3efbdbd3.452541024@news.erols.com>
William Goedicke <goedicke@goedsole.com> wrote:
: Sorry, for the personal nature of this post, but I've had no
: response to my last dozen questions.
That sounds high. I only remember seeing two--one about a universally
convertible report format, and one about cycles in graphs.
Recap?
: Did I offend with poor etiquette
Thpt. Clpm readers will attempt to correct etiquette mistakes.
Killfiling is reserved for the pathologically clueless, and that's not
you.
: or are my questions just hard to answer?
That sounds more like it.
Or maybe your newsfeed is dropping articles.
------------------------------
Date: 27 Jun 2003 00:45:59 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Am I being boycotted?
Message-Id: <3efbf637@news.victoria.tc.ca>
William Goedicke (goedicke@goedsole.com) wrote:
: Dear Tassilo -
: >>>>> "Tassilo" == Tassilo v Parseval <tassilo.parseval@rwth-aachen.de> writes:
: Tassilo> I don't think it's a boycott. Instead I guess no one had
: Tassilo> something intelligent to say.
: That's a relief.
: Tassilo> Your last question was something above detecting cycles
: Tassilo> in a graph. We had the graph-issue a couple of times here
: Tassilo> lately so perhaps the group was a little fed up with this
: Tassilo> topic. :-)
: Should I conclude that we haven't figured out how to recognize cycles?
No, "we" should recognize that most of us aren't working with cyclic
graphs and so have nothing helpful to say, and our jobs or contracts give
no justification for taking the time to examine the issue.
------------------------------
Date: 27 Jun 2003 08:22:01 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Am I being boycotted?
Message-Id: <bdgur9$iff$1@mamenchi.zrz.TU-Berlin.DE>
William Goedicke <goedicke@goedsole.com> wrote in comp.lang.perl.misc:
> Dear Tassilo -
>
> >>>>> "Tassilo" == Tassilo v Parseval <tassilo.parseval@rwth-aachen.de> writes:
>
> Tassilo> I don't think it's a boycott. Instead I guess no one had
> Tassilo> something intelligent to say.
>
> That's a relief.
>
> Tassilo> Your last question was something above detecting cycles
> Tassilo> in a graph. We had the graph-issue a couple of times here
> Tassilo> lately so perhaps the group was a little fed up with this
> Tassilo> topic. :-)
>
> Should I conclude that we haven't figured out how to recognize cycles?
That wouldn't be the job of a Perl newsgroup.
AFAIK cycle detection in graphs is algorithmically well covered, there
is no need to figure anything out. Just pick up any book about graph
theory. The only problem is the implementation in Perl of a standard
algorithm, or finding an existing implementation on CPAN.
Anno
------------------------------
Date: Fri, 27 Jun 2003 05:59:53 GMT
From: "John" <SeeMessageBody@nospam.com>
Subject: Anybody making Windows interfaces w/ Perl?
Message-Id: <t3RKa.14617$C83.1382932@newsread1.prod.itd.earthlink.net>
The sample below makes a simple message box in MS Windows. The rest of the
Win32 and Win32API modules includes handy interfaces to the OS, but no other
GUI objects like the message box (e.g., radio boxes, pull-down menus,
fill-in forms, etc.). Or am I missing something?
I am about to install and learn Visual C++ 6 and want to make sure I'm not
wasting my time. I would prefer to keep everything pure Perl if possible.
[Aside: I think the TCL stuff for Perl on Unix making GUIs on X
Windows --is that right?]
------------------------------------------------
Feel free to mail me: workingstiff19
...and that's at hotmail.
### This was done in Active Perl 5.006001 ####
use Win32;
# display a message box with an exclamation mark and an 'OK' button
MsgBox("Test", "This is a test", 48);
exit 0;
sub MsgBox {
my ($caption, $message, $icon_buttons) = @_;
my @return = qw/- Ok Cancel Abort Retry Ignore Yes No/;
my $result = Win32::MsgBox($message, $icon_buttons, $caption);
return $return[$result];
}
------------------------------
Date: 27 Jun 2003 07:32:33 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: Anybody making Windows interfaces w/ Perl?
Message-Id: <slrnbfnsoh.o7t.damian@puma.qimr.edu.au>
On Fri, 27 Jun 2003 05:59:53 GMT, John said:
>The sample below makes a simple message box in MS Windows. The rest of the
>Win32 and Win32API modules includes handy interfaces to the OS, but no other
>GUI objects like the message box (e.g., radio boxes, pull-down menus,
>fill-in forms, etc.). Or am I missing something?
Off the top of my head:
Tk (on CPAN)
Win32::GUI (on CPAN)
WxPerl ( http://wxperl.sourceforge.net )
and you might be interested in:
GUI Loft ( http://www.bahnhof.se/~johanl/perl/Loft )
>I am about to install and learn Visual C++ 6 and want to make sure I'm not
>wasting my time. I would prefer to keep everything pure Perl if possible.
>
>[Aside: I think the TCL stuff for Perl on Unix making GUIs on X
>Windows --is that right?]
That would be Tk.
--damian
------------------------------
Date: Fri, 27 Jun 2003 01:44:18 -0700
From: "Alan C." <a@c.com>
Subject: Re: Anybody making Windows interfaces w/ Perl?
Message-Id: <vfo0iqrkju0df4@corp.supernews.com>
"John" <SeeMessageBody@nospam.com> wrote in message
news:t3RKa.14617$C83.1382932@newsread1.prod.itd.earthlink.net...
> The sample below makes a simple message box in MS Windows. The rest of
the
> Win32 and Win32API modules includes handy interfaces to the OS, but no
other
> GUI objects like the message box (e.g., radio boxes, pull-down menus,
> fill-in forms, etc.). Or am I missing something?
perldoc tk
on my Win machine with Activestate Perl 5.6.1 build 633 brings up docs for
the TK module.
widget
when typed and entered on my command line brings up a widget demo which
include at least some if not all of what you say is not in those Perl
modules that you mentioned.
>
> I am about to install and learn Visual C++ 6 and want to make sure I'm not
> wasting my time. I would prefer to keep everything pure Perl if possible.
I'm unfamiliar if there exists any capability differences between those two;
so, no comment.
<snip>
> ### This was done in Active Perl 5.006001
####
<snipped the mentioned sample>
I mentioned some native things in the version of Perl on my Win.
--
Alan.
------------------------------
Date: 27 Jun 2003 01:24:09 -0700
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: Database Connection Pooling in Perl CGI Script WITHOUT mod_perl
Message-Id: <1bff1830.0306270024.752370c3@posting.google.com>
pmbutler@attbi.com (Pete Butler) wrote in message news:<9b766f0.0306240936.3832028c@posting.google.com>...
> I'm working on a Perl CGI application, and I'd like to set up database
> connection pooling for obvious performance-related reasons.
>
> However, the server I'm working on is provided by a third party, so I
> do NOT have access to mod_perl.
>
> Does anybody know of a way I can do connection pooling under these
> conditions? Or am I just screwed without mod_perl?
>
Does you hosting co. offer any other alternatives, such as fastcgi or
php?
As you now know, the biggest performance problem is CGI (fork, exec,
script compilation etc....) Many hosting companies Ive seen offer
php, which is usually embedded in the web server and the api's for
databases usually have a cached connection option.
(Im not saying php is better than perl, but embedded php in the
webserver would probably have better performance than a perl CGI app).
> (The database I'm accessing is MySQL, if that matters.)
>
> Thanks,
> -- Pete Butler
------------------------------
Date: Fri, 27 Jun 2003 09:42:37 +0200
From: =?ISO-8859-1?Q?Johannes_F=FCrnkranz?= <johannes.fuernkranz@t-online.de>
Subject: Hash::Utils lock_keys
Message-Id: <bdgshq$gm3$03$1@news.t-online.com>
Hi,
I don't have the 3rd edition of the Camel-book, so pardon me if this is
covered there:
Can anybody explain the purpose of Hash::Util::lock_keys to me?
I would have expected that this does something like internally convert
the hash to an array and/or provide faster access to the hash elements
by somehow avoiding to compute the hashing function for each element. I
tested this with Benchmark, but I could not find any noticable
difference between retrieving a key from a locked hash or a regular
hash. The only difference I note is, of course, the error message that I
get when I try to access an undefined slot of the locked hash. Is that all?
thx, Juffi
------------------------------
Date: Fri, 27 Jun 2003 09:16:42 +0200
From: Olof Karlberg <Olof.KarlbergNOSPAMatebc.uu.se>
Subject: How does @LAST_MATCH_START work?
Message-Id: <20030627091642.72fa3e9d.Olof.KarlbergNOSPAMatebc.uu.se@molev155.ebc.uu.se>
Hi,
I am looking for a way to find the locations of exact substring matches (0.1-3 KB) in a larger string (1-2MB) and was looking at the variables @LAST_MATCH_START and @LAST_MATCH_END (@-/@+) as a solution. The problem is that I just can't get these variables to work the way I thought they should work. As I understand perdoc perlvar on this, the code below _should_ print:
Number of matches: 2
First match begins at: 2
First match ends at: 5
2:nd match begins at: 9
2:nd match ends at: 12
However, what it _does_ print is:
Number of matches: 0
First match begins at: 2
First match ends at: 5
Use of uninitialized value in concatenation (.) or string at ./test.pl line 10.
2:nd match begins at:
Use of uninitialized value in concatenation (.) or string at ./test.pl line 11.
2:nd match ends at:
#!/usr/bin/perl -w
my $target = "QWERTY QWERTY";
my $query = "ERT";
$target =~ m/$query/g;
print "Number of matches: $#-\n";
print "First match begins at: $-[0]\n";
print "First match ends at: $+[0]\n";
print "2:nd match begins at: $-[1]\n";
print "2:nd match ends at: $+[1]\n";
What is going on here? Have I totally misunderstood the docs?
The above is the result from Perl 5.8.0 on a new Gentoo Linux system (gcc version 3.2.2). The same code on Perl 5.6.1 on Suse 8.0 (gcc version 2.95.3) gives the same printout as above with the following diff:
Number of matches: 2020961897
Anyone else seen this behaviour?
//Olof
------------------------------
Date: Fri, 27 Jun 2003 08:35:37 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: How does @LAST_MATCH_START work?
Message-Id: <bdgvkp$o0k$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Olof Karlberg
<Olof.KarlbergNOSPAMat.ebc.uu.se>], who wrote in article <20030627091642.72fa3e9d.Olof.KarlbergNOSPAMatebc.uu.se@molev155.ebc.uu.se>:
> $target =~ m/$query/g;
> print "Number of matches: $#-\n";
Some time ago the parser had a hard time groking this. I would try
$#{'-'} or some such instead.
Ilya
------------------------------
Date: Thu, 26 Jun 2003 22:24:26 -0700
From: "David Oswald" <spamblock@junkmail.com>
Subject: Re: Offer tips, comments on this code (generates html to index image files)
Message-Id: <vfnlgidpisan7c@corp.supernews.com>
"Eric Schwartz" <emschwar@pobox.com> wrote in message
news:etoadc4pia7.fsf@wormtongue.emschwar...
<snip>
> FYI, I know you said no features, but it'd be handy if it printed the
> date the file was created as well-- I like knowing how old it's meant
> to be.
>
That's a great idea. I'll get to work on it.
Having played with localtime(time); I'm not encouraged though. Surely there
must be a better way than trying to match a bunch of days of the week, month
names, and re-constructing 12hr time out of a 24hr format. Is there
something already lurking on the dusty shelf that converts the output of
localtime(time) to one nice $now of 12hr time so that I can print HTML "Last
updated: $now\n"; ?
Not to mention the fact that typing "date" at the shell prompt gives me a
correct date, yet the raw dump of "localtime(time)" thinks it's four in the
afternoon (it's ten at night really) December 31st, the 364th day of the
year (reality is June). I suspect that my sysadmin has the time wrong on
the computer that's hosting the perl engine.
Dave
------------------------------
Date: 27 Jun 2003 02:39:20 -0700
From: gordon@ockham.be (gordon)
Subject: Re: perlio problem? redhat 9, perl 5.8.0
Message-Id: <2369e2ad.0306270139.284699df@posting.google.com>
"Alan J. Flavell" <flavell@mail.cern.ch> wrote in message news:<Pine.LNX.4.53.0306261459170.6298@lxplus090.cern.ch>...
> On Tue, Jun 24, gordon inscribed on the eternal scroll:
>
> (well, no-one seems to have offered an answer, so I suppose I might
> try...)
>
> > The weird thing is that with a 5.8.0 compiled from source with default
> > settings, both matches work, which is what we'd expect.
>
> I don't see any logical reason why it would not work, so I'd rate it
> prima facie as a bug in the particular implementation that was
> giving the problem.
>
> Sorry, I'm not in a position to reproduce your error, so I'm neither
> confirming nor denying your report - just saying that on the basis of
> what you reported, it does seem like a bug.
>
> > Here's a tiny script to show the problem:
>
> [works for me, on several different platforms, but I didn't have the
> specific one you mentioned]
>
> (I think you'd need to report the release details of the RPM,
> the output of perl -V and so forth, to make it a proper bug report.)
>
> As you rightly say: with all of the characters involved being
> us-ascii, there shouldn't be any difference. Could it be that for
> some bizarre reason one of them got "upgraded" to unicode, and the
> other didn't, and they were then reported as not matching? But I
> might be talking rowlocks - it needs someone who understands the
> internals.
Thanks for your comments!
Yeah, it looks like a bug to me the more I look at it. There's no
reason,
unicodedness or otherwise, that a match using [^\s] fails, and using
[\S]
or \S works. The printout of the strings that occurs in the test
script
show good text so nothing's obviously out of whack. Oh and, as you
point out,
it runs fine on lots of systems.
FYI this was a pristine installation of redhat 9 inside of vmware.
I'd not upgraded the perl or anything when I got the problem. The
perl -V is attached to the end of this message in case someone can say
"my god, why did they use *those* options" :) -- I'll report a bug to,
errr, redhat or perl.
It would be good though to have confirmation from someone else who can
run this
on a pristine redhat 9 with no LC_ALL=POSIX or C in their environment.
perl -V:Summary of my perl5 (revision 5.0 version 8 subversion 0)
configuration:
Platform:
osname=linux, osvers=2.4.20-2.48smp,
archname=i386-linux-thread-multi
uname='linux str'
config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -g
-Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red
Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux
-Dvendorprefix=/usr -Dsiteprefix=/usr
-Dotherlibdirs=/usr/lib/perl5/5.8.0 -Duseshrplib -Dusethreads
-Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db
-Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio
-Dinstallusrbinperl -Ubincompat5005 -Uversiononly
-Dpager=/usr/bin/less -isr'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef'
useithreads=define usemultiplicity=
useperlio= d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=un uselongdouble=
usemymalloc=, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBUGGING -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBUGGING -fno-strict-aliasing -I/usr/local/include
-I/usr/include/gdbm'
ccversion='', gccversion='3.2.2 20030213 (Red Hat Linux 8.0
3.2.2-1)', gccosandvers=''
gccversion='3.2.2 200302'
intsize=e, longsize= , ptrsize=p, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
ivtype='long'
k', ivsize=4'
ivtype='long'
known_ext, nvtype='double'
o_nonbl', nvsize=, Off_t='', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc'
l', ldflags =' -L/usr/local/lib'
ldf'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
perllibs=
libc=/lib/libc-2.3.1.so, so=so, useshrplib=true, libperl=libper
gnulibc_version='2.3.1'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so', d_dlsymun=undef,
ccdlflags='-rdynamic
-Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE'
cccdlflags='-fPIC'
ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5', lddlflags='s
Unicode/Normalize XS/A'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS
USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Locally applied patches:
MAINT18379
Built under linux
Compiled at Feb 18 2003 22:19:53
@INC:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
.
- gordon
------------------------------
Date: Fri, 27 Jun 2003 02:22:10 -0500
From: tadmc@augustmail.com
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.4 $)
Message-Id: <kbCdnWZGuuE_bWajRTvU2Q@august.net>
Outline
Before posting to comp.lang.perl.misc
Must
- Check the Perl Frequently Asked Questions (FAQ)
- Check the other standard Perl docs (*.pod)
Really Really Should
- Lurk for a while before posting
- Search a Usenet archive
If You Like
- Check Other Resources
Posting to comp.lang.perl.misc
Is there a better place to ask your question?
- Question should be about Perl, not about the application area
How to participate (post) in the clpmisc community
- Carefully choose the contents of your Subject header
- Use an effective followup style
- Speak Perl rather than English, when possible
- Ask perl to help you
- Do not re-type Perl code
- Provide enough information
- Do not provide too much information
- Do not post binaries, HTML, or MIME
Social faux pas to avoid
- Asking a Frequently Asked Question
- Asking a question easily answered by a cursory doc search
- Asking for emailed answers
- Beware of saying "doesn't work"
- Sending a "stealth" Cc copy
Be extra cautious when you get upset
- Count to ten before composing a followup when you are upset
- Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------
Posting Guidelines for comp.lang.perl.misc ($Revision: 1.4 $)
This newsgroup, commonly called clpmisc, is a technical newsgroup
intended to be used for discussion of Perl related issues (except job
postings), whether it be comments or questions.
As you would expect, clpmisc discussions are usually very technical in
nature and there are conventions for conduct in technical newsgroups
going somewhat beyond those in non-technical newsgroups.
This article describes things that you should, and should not, do to
increase your chances of getting an answer to your Perl question. It is
available in POD, HTML and plain text formats at:
http://mail.augustmail.com/~tadmc/clpmisc.shtml
For more information about netiquette in general, see the "Netiquette
Guidelines" at:
http://andrew2.andrew.cmu.edu/rfc/rfc1855.html
A note to newsgroup "regulars":
Do not use these guidelines as a "license to flame" or other
meanness. It is possible that a poster is unaware of things
discussed here. Give them the benefit of the doubt, and just
help them learn how to post, rather than assume
A note about technical terms used here:
In this document, we use words like "must" and "should" as
they're used in technical conversation (such as you will
encounter in this newsgroup). When we say that you *must* do
something, we mean that if you don't do that something, then
it's unlikely that you will benefit much from this group.
We're not bossing you around; we're making the point without
lots of words.
Do *NOT* send email to the maintainer of these guidelines. It will be
discarded unread. The guidelines belong to the newsgroup so all
discussion should appear in the newsgroup. I am just the secretary that
writes down the consensus of the group.
Before posting to comp.lang.perl.misc
Must
This section describes things that you *must* do before posting to
clpmisc, in order to maximize your chances of getting meaningful replies
to your inquiry and to avoid getting flamed for being lazy and trying to
have others do your work.
The perl distribution includes documentation that is copied to your hard
drive when you install perl. Also installed is a program for looking
things up in that (and other) documentation named 'perldoc'.
You should either find out where the docs got installed on your system,
or use perldoc to find them for you. Type "perldoc perldoc" to learn how
to use perldoc itself. Type "perldoc perl" to start reading Perl's
standard documentation.
Check the Perl Frequently Asked Questions (FAQ)
Checking the FAQ before posting is required in Big 8 newsgroups in
general, there is nothing clpmisc-specific about this requirement.
You are expected to do this in nearly all newsgroups.
You can use the "-q" switch with perldoc to do a word search of the
questions in the Perl FAQs.
Check the other standard Perl docs (*.pod)
The perl distribution comes with much more documentation than is
available for most other newsgroups, so in clpmisc you should also
see if you can find an answer in the other (non-FAQ) standard docs
before posting.
It is *not* required, or even expected, that you actually *read* all of
Perl's standard docs, only that you spend a few minutes searching them
before posting.
Try doing a word-search in the standard docs for some words/phrases
taken from your problem statement or from your very carefully worded
"Subject:" header.
Really Really Should
This section describes things that you *really should* do before posting
to clpmisc.
Lurk for a while before posting
This is very important and expected in all newsgroups. Lurking means
to monitor a newsgroup for a period to become familiar with local
customs. Each newsgroup has specific customs and rituals. Knowing
these before you participate will help avoid embarrassing social
situations. Consider yourself to be a foreigner at first!
Search a Usenet archive
There are tens of thousands of Perl programmers. It is very likely
that your question has already been asked (and answered). See if you
can find where it has already been answered.
One such searchable archive is:
http://groups.google.com/advanced_group_search
If You Like
This section describes things that you *can* do before posting to
clpmisc.
Check Other Resources
You may want to check in books or on web sites to see if you can
find the answer to your question.
But you need to consider the source of such information: there are a
lot of very poor Perl books and web sites, and several good ones
too, of course.
Posting to comp.lang.perl.misc
There can be 200 messages in clpmisc in a single day. Nobody is going to
read every article. They must decide somehow which articles they are
going to read, and which they will skip.
Your post is in competition with 199 other posts. You need to "win"
before a person who can help you will even read your question.
These sections describe how you can help keep your article from being
one of the "skipped" ones.
Is there a better place to ask your question?
Question should be about Perl, not about the application area
It can be difficult to separate out where your problem really is,
but you should make a conscious effort to post to the most
applicable newsgroup. That is, after all, where you are the most
likely to find the people who know how to answer your question.
Being able to "partition" a problem is an essential skill for
effectively troubleshooting programming problems. If you don't get
that right, you end up looking for answers in the wrong places.
It should be understood that you may not know that the root of your
problem is not Perl-related (the two most frequent ones are CGI and
Operating System related), so off-topic postings will happen from
time to time. Be gracious when someone helps you find a better place
to ask your question by pointing you to a more applicable newsgroup.
How to participate (post) in the clpmisc community
Carefully choose the contents of your Subject header
You have 40 precious characters of Subject to win out and be one of
the posts that gets read. Don't waste them. Take care while
composing them, they are the key that opens the door to getting an
answer.
Spend them indicating what aspect of Perl others will find if they
should decide to read your article.
Do not spend them indicating "experience level" (guru, newbie...).
Do not spend them pleading (please read, urgent, help!...).
Do not spend them on non-Subjects (Perl question, one-word
Subject...)
For more information on choosing a Subject see "Choosing Good
Subject Lines":
http://www.cpan.org/authors/id/D/DM/DMR/subjects.post
Part of the beauty of newsgroup dynamics, is that you can contribute
to the community with your very first post! If your choice of
Subject leads a fellow Perler to find the thread you are starting,
then even asking a question helps us all.
Use an effective followup style
When composing a followup, quote only enough text to establish the
context for the comments that you will add. Always indicate who
wrote the quoted material. Never quote an entire article. Never
quote a .signature (unless that is what you are commenting on).
Intersperse your comments *following* each section of quoted text to
which they relate. Unappreciated followup styles are referred to as
"Jeopardy" (because the answer comes before the question), or
"TOFU".
Reversing the chronology of the dialog makes it much harder to
understand (some folks won't even read it if written in that style).
For more information on quoting style, see:
http://web.presby.edu/~nnqadmin/nnq/nquote.html
Speak Perl rather than English, when possible
Perl is much more precise than natural language. Saying it in Perl
instead will avoid misunderstanding your question or problem.
Do not say: I have variable with "foo\tbar" in it.
Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
or I have $var = <DATA> (and show the data line).
Ask perl to help you
You can ask perl itself to help you find common programming mistakes
by doing two things: enable warnings (perldoc warnings) and enable
"strict"ures (perldoc strict).
You should not bother the hundreds/thousands of readers of the
newsgroup without first seeing if a machine can help you find your
problem. It is demeaning to be asked to do the work of a machine. It
will annoy the readers of your article.
You can look up any of the messages that perl might issue to find
out what the message means and how to resolve the potential mistake
(perldoc perldiag). If you would like perl to look them up for you,
you can put "use diagnostics;" near the top of your program.
Do not re-type Perl code
Use copy/paste or your editor's "import" function rather than
attempting to type in your code. If you make a typo you will get
followups about your typos instead of about the question you are
trying to get answered.
Provide enough information
If you do the things in this item, you will have an Extremely Good
chance of getting people to try and help you with your problem!
These features are a really big bonus toward your question winning
out over all of the other posts that you are competing with.
First make a short (less than 20-30 lines) and *complete* program
that illustrates the problem you are having. People should be able
to run your program by copy/pasting the code from your article. (You
will find that doing this step very often reveals your problem
directly. Leading to an answer much more quickly and reliably than
posting to Usenet.)
Describe *precisely* the input to your program. Also provide example
input data for your program. If you need to show file input, use the
__DATA__ token (perldata.pod) to provide the file contents inside of
your Perl program.
Show the output (including the verbatim text of any messages) of
your program.
Describe how you want the output to be different from what you are
getting.
If you have no idea at all of how to code up your situation, be sure
to at least describe the 2 things that you *do* know: input and
desired output.
Do not provide too much information
Do not just post your entire program for debugging. Most especially
do not post someone *else's* entire program.
Do not post binaries, HTML, or MIME
clpmisc is a text only newsgroup. If you have images or binaries
that explain your question, put them in a publically accessible
place (like a Web server) and provide a pointer to that location. If
you include code, cut and paste it directly in the message body.
Don't attach anything to the message. Don't post vcards or HTML.
Many people (and even some Usenet servers) will automatically filter
out such messages. Many people will not be able to easily read your
post. Plain text is something everyone can read.
Social faux pas to avoid
The first two below are symptoms of lots of FAQ asking here in clpmisc.
It happens so often that folks will assume that it is happening yet
again. If you have looked but not found, or found but didn't understand
the docs, say so in your article.
Asking a Frequently Asked Question
It should be understood that you may have missed the applicable FAQ
when you checked, which is not a big deal. But if the Frequently
Asked Question is worded similar to your question, folks will assume
that you did not look at all. Don't become indignant at pointers to
the FAQ, particularly if it solves your problem.
Asking a question easily answered by a cursory doc search
If folks think you have not even tried the obvious step of reading
the docs applicable to your problem, they are likely to become
annoyed.
If you are flamed for not checking when you *did* check, then just
shrug it off (and take the answer that you got).
Asking for emailed answers
Emailed answers benefit one person. Posted answers benefit the
entire community. If folks can take the time to answer your
question, then you can take the time to go get the answer in the
same place where you asked the question.
It is OK to ask for a *copy* of the answer to be emailed, but many
will ignore such requests anyway. If you munge your address, you
should never expect (or ask) to get email in response to a Usenet
post.
Ask the question here, get the answer here (maybe).
Beware of saying "doesn't work"
This is a "red flag" phrase. If you find yourself writing that,
pause and see if you can't describe what is not working without
saying "doesn't work". That is, describe how it is not what you
want.
Sending a "stealth" Cc copy
A "stealth Cc" is when you both email and post a reply without
indicating *in the body* that you are doing so.
Be extra cautious when you get upset
Count to ten before composing a followup when you are upset
This is recommended in all Usenet newsgroups. Here in clpmisc, most
flaming sub-threads are not about any feature of Perl at all! They
are most often for what was seen as a breach of netiquette. If you
have lurked for a bit, then you will know what is expected and won't
make such posts in the first place.
But if you get upset, wait a while before writing your followup. I
recommend waiting at least 30 minutes.
Count to ten after composing and before posting when you are upset
After you have written your followup, wait *another* 30 minutes
before committing yourself by posting it. You cannot take it back
once it has been said.
AUTHOR
Tad McClellan <tadmc@augustmail.com> and many others on the
comp.lang.perl.misc newsgroup.
------------------------------
Date: Fri, 27 Jun 2003 09:53:51 +0800
From: "Bob Heye" <heye@v2tech.com>
Subject: Re: problem when use debug perl in win2000 os
Message-Id: <bdg82e$9so$1@mail.cn99.com>
Thank you brian.
Why can't I think of the configuration problem:(
"Brian Helterline" <brian_helterline@hp.com> 写入消息新闻
:3efb609c$1@usenet01.boi.hp.com...
>
> "Bob Heye" <heye@v2tech.com> wrote in message
> news:bde59v$1ros$1@mail.cn99.com...
> > Hi,all
> > I have such a problem, someone can help me?
> >
> > When I debug a program written in perl using "perl -d foo.pl"
> > The following message show up:
> > ================================
> > Unable to connect to remote host: 127.0.0.1:2000
> > Compilation failed in require.
> > main::BEGIN() called at D:/Perl/5.8.0/lib/perl5db.pl line 0
> > eval {...} called at D:/Perl/5.8.0/lib/perl5db.pl line 0
> > BEGIN failed--compilation aborted.
> > ================================
> > My OS is win2000, and the perl version is 5.8.0.
> > If I don't debug it, just run it ( perl foo.pl), everything is fine.
> >
> > Any comments will be appreciated.
> > Regrads
> >
> > BobH
> >
> Make sure that you don't have the PERLDB_OPTS environment variable
> configured to use remote debugging.
>
> This same problem bit me also. If I remember correctly it was after I
> installed a trial version of Visual Perl (or ASPEN perl) and then removed
> it. This variable was left behind....
>
> -brian
>
>
>
------------------------------
Date: Fri, 27 Jun 2003 08:41:37 GMT
From: derek / nul <abuse@sgrail.org>
Subject: Using local $/
Message-Id: <ll0ofvgir9u8kvpdtl4g55qj9bunn9tafo@4ax.com>
I am using the local $/ so that I can get the whole of a binary file into a
variable.
Later in the program I need to reset the $/ to what it was, but I cannot seem to
find any information on what it is initialised as.
Any pointers?
Derek
------------------------------
Date: Fri, 27 Jun 2003 08:46:38 +0000 (UTC)
From: "Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Using local $/
Message-Id: <Xns93A76D37E9354elhber1lidotechnet@62.89.127.66>
derek / nul wrote:
> I am using the local $/ so that I can get the whole of a binary file
> into a variable.
>
> Later in the program I need to reset the $/ to what it was, but I
> cannot seem to find any information on what it is initialised as.
>
> Any pointers?
If you're correctly using local() then there's no need to remember what the
previous value of $/ was since that's what local() does! For example,
-----------------------------
print "Before block: [$/]";
{
local $/ = 'blah';
print "Inside block: [$/]";
}
print "After block: [$/]";
-----------------------------
It's all explained in the docs:
perldoc -f local
--
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: 27 Jun 2003 09:04:12 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Using local $/
Message-Id: <bdh1ac$iff$2@mamenchi.zrz.TU-Berlin.DE>
derek / nul <abuse@sgrail.org> wrote in comp.lang.perl.misc:
> I am using the local $/ so that I can get the whole of a binary file into a
> variable.
Speaking of "the local $/" seems to indicate a misunderstanding. There
is no local $/ as opposed to the global one. "local" gives the *same*
variable $/ a temporary value, where "temporary" means "valid until the
end of the current block, at which point it will be reset to the previous
value".
The full form of the statement is really "local $/ = 'xyz'", where 'xyz'
is the temporary value. Leaving out the assignment makes Perl use
an undefined value instead. Since that is what you want for file
slurping, you can use that form, but it's still a temporary assignment.
In another posting Bernard El-Hagin has given an example of how this
works.
Anno
------------------------------
Date: Fri, 27 Jun 2003 09:23:52 GMT
From: derek / nul <abuse@sgrail.org>
Subject: Re: Using local $/
Message-Id: <683ofv40tc2tjhrmvp4jg96rrnpp7sblth@4ax.com>
On Fri, 27 Jun 2003 08:46:38 +0000 (UTC), "Bernard El-Hagin"
<bernard.el-hagin@DODGE_THISlido-tech.net> wrote:
>derek / nul wrote:
>
>> I am using the local $/ so that I can get the whole of a binary file
>> into a variable.
>>
>> Later in the program I need to reset the $/ to what it was, but I
>> cannot seem to find any information on what it is initialised as.
>>
>> Any pointers?
>
>
>If you're correctly using local() then there's no need to remember what the
>previous value of $/ was since that's what local() does! For example,
>
>
>-----------------------------
>print "Before block: [$/]";
>
>{
> local $/ = 'blah';
> print "Inside block: [$/]";
>}
>
>print "After block: [$/]";
>-----------------------------
I was using local ok, but I stuffed up the block.
thanks
------------------------------
Date: Fri, 27 Jun 2003 11:23:46 +0200
From: =?ISO-8859-1?Q?Johannes_F=FCrnkranz?= <johannes.fuernkranz@t-online.de>
Subject: Re: Using local $/
Message-Id: <bdh2fg$7lj$01$1@news.t-online.com>
derek / nul wrote:
> I am using the local $/ so that I can get the whole of a binary file into a
> variable.
>
> Later in the program I need to reset the $/ to what it was, but I cannot seem to
> find any information on what it is initialised as.
>
> Any pointers?
>
> Derek
1. If you use local to change the value in a block, you do not need to
reset it afterwards, because the change is only, well, local.
2. If you do need to reset it for some reason, it's probably better
reset it to the value it previously had, not to the default value.
3. It is initialized to "\n".
Juffi
------------------------------
Date: Fri, 27 Jun 2003 09:34:30 GMT
From: derek / nul <abuse@sgrail.org>
Subject: Re: Using local $/
Message-Id: <qo3ofvo7723f2a8ts7mqt4iqj5c81nvrfg@4ax.com>
On 27 Jun 2003 09:04:12 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
wrote:
>derek / nul <abuse@sgrail.org> wrote in comp.lang.perl.misc:
>> I am using the local $/ so that I can get the whole of a binary file into a
>> variable.
>
>Speaking of "the local $/" seems to indicate a misunderstanding. There
>is no local $/ as opposed to the global one. "local" gives the *same*
>variable $/ a temporary value, where "temporary" means "valid until the
>end of the current block, at which point it will be reset to the previous
>value".
I was misunderstanding its use,
I assume it normally contains 'cr lf'? as this is how the while operator gets a
line at a time?
Derek
------------------------------
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 5144
***************************************