[9374] in Perl-Users-Digest
Perl-Users Digest, Issue: 2969 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 24 18:08:58 1998
Date: Wed, 24 Jun 98 15:00:32 -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 Wed, 24 Jun 1998 Volume: 8 Number: 2969
Today's topics:
autovivification and tie questions <mps@shellus.com>
Re: autovivification and tie questions <tchrist@mox.perl.com>
Re: Can someone help me find a script? <rootbeer@teleport.com>
Re: Colored report entries in Perl? <rootbeer@teleport.com>
Re: Colored report entries in Perl? (Jack Ostroff)
Re: Date Calculation Problems. <colin.riddle@scotmail.com>
Re: Flames.... (Craig Berry)
Re: Flames.... (T. Ames)
Re: foreach not reading array? <rootbeer@teleport.com>
Re: Have we got a good free Perl manual? (d)
Re: Looking for Perl Application, PLEASE HELP <rootbeer@teleport.com>
Re: NEwbie question: how do I find string length? (Gabor)
Re: Searching through a file <rootbeer@teleport.com>
Re: string substitution <rootbeer@teleport.com>
Re: system() and security again <tchrist@mox.perl.com>
Re: What a Crappy World (oh, yes!) <ljz@asfast.com>
Re: What a Crappy World (oh, yes!) (Matt Knecht)
Re: What a Crappy World (oh, yes!) <ljz@asfast.com>
Re: What a Crappy World (oh, yes!) <upsetter@ziplink.net>
Re: What a Crappy World <ljz@asfast.com>
Re: What a Crappy World <tchrist@mox.perl.com>
Re: What a Crappy World (Matt Knecht)
Re: What a Crappy World <upsetter@ziplink.net>
Re: What a Crappy World <upsetter@ziplink.net>
WIN32::ODBC jhildeb2@my-dejanews.com
Re: Would someone tell me what this means? <jdporter@min.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 24 Jun 1998 16:02:17 -0500
From: Matt Sisk <mps@shellus.com>
Subject: autovivification and tie questions
Message-Id: <35916959.AD031FBD@shellus.com>
[Our mail server recently barfed - might be a repeat question here, but
I haven't seen the first attempt appear on Dejanews yet, so I'm assuming
it was lost...]
Assume a multidimensional hash, the first dimension of which is a tied
hash where FETCH() and STORE() are in the business of hash references as
you might expect. So for a pre-populated data structure, everything
works normally:
tie %mytie, HashOfHashRefs;
$mytie{a} = \%mygoodies;
# no prob - HashOfHashRefs::STORE('a',\%mygoodies)
$mytie{a};
# no prob - HashOfHashRefs::FETCH('a') returns ref
$mytie{a}{b};
# no prob - HashOfHashRefs::FETCH('a')->{b}
$mytie{a}{b} = 'goody';
# no prob - HashOfHashRefs::FETCH('a')->{b} = 'goody'
But if you try something like:
tie %mytie, HashOfHashRefs;
$mytie{a};
# FETCH is not forceful - return undef
$mytie{a}{b} = 'goody';
# Doh! FETCH('a') still has no ref to return! Fail!
When $myhash{a} has never been referenced before, then the assignment
will obviously fail. Correct me if I'm wrong in presuming FETCH is
involved in all of these cases.
So I have three questions:
1) Just out of curiousity, how does normal, untied, autovivification
work? Is Perl looking ahead, creating an anonymous hash ref, then
making the assignment, or something less obvious?
2) Short of making FETCH *always* invoke STORE when a key is unknown, is
there any way to communicate to FETCH that an assignment will be
happening farther down the line?
3) I suspect that the answer is just to make sure and pre-allocate the
hash references in this case, knowing that the tied hash probably can't
deal with it. Unless there's something I'm missing in how this all
works.
Thanks for any elaboration,
Matt Sisk mps@shellus.com
------------------------------
Date: 24 Jun 1998 21:28:28 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: autovivification and tie questions
Message-Id: <6mrr1s$b12$4@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Matt Sisk <mps@shellus.com> writes:
:[Our mail server recently barfed - might be a repeat question here, but
:I haven't seen the first attempt appear on Dejanews yet, so I'm assuming
:it was lost...]
I didn't see it. But wasn't looking.
I think that Sarathy and/or Abigail and some unpleasant
experience in these areas. You might check with them.
--tom
--
> This made me wonder, suddenly: can telnet be written in perl?
Of course it can be written in Perl. Now if you'd said nroff,
that would be more challenging... --Larry Wall
------------------------------
Date: Wed, 24 Jun 1998 21:14:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Can someone help me find a script?
Message-Id: <Pine.GSO.3.96.980624141340.14091L-100000@user2.teleport.com>
On Wed, 24 Jun 1998 kjernigan@geocities.com wrote:
> Subject: Can someone help me find a script?
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 24 Jun 1998 21:10:47 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Colored report entries in Perl?
Message-Id: <Pine.GSO.3.96.980624140858.14091K-100000@user2.teleport.com>
On 24 Jun 1998, AgentNo007 wrote:
> Does anyone know if Perl has a way of printing certain colors on a
> report output?
Perl itself knows nothing about colors. But if your output device can be
told to use certain colors, Perl can (almost certainly) be used to do the
telling.
You should be able to find the details in the docs, FAQs, and newsgroups
about your output device or output format. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 24 Jun 1998 20:42:26 GMT
From: jack_h_ostroff@groton.pfizer.com (Jack Ostroff)
To: agentno007@aol.com (AgentNo007)
Subject: Re: Colored report entries in Perl?
Message-Id: <6mrobi$5531@mascagni.pfizer.com>
[reply emailed to original author and posted]
In article <1998062419054400.PAA16376@ladder01.news.aol.com>, agentno007@aol.com (AgentNo007) writes:
> Does anyone know if Perl has a way of printing certain colors on a report
> output? I am writing Perl on Unix, and want the output to display different
> colors on a report. The report entries are in rows, not columns.
>
> For example:
> Red line for entries with the string "Failure"
> Yellow line for entries with the string "Retry"
> Green line for entries with the string "Sucess"
>
> Anyone know if there is a way? I am using X-windows, and the fonts are
> customizable is that helps. Thanks in advance.
>
> -Jonathan Gines
> Sr. Engineer, UUNET Technologies
> jsgines@uu.net
This really doesn't have anything to do with Perl. You have to find out how to specify colors on the
specific output device you are using. "X-windows" is not specific enough. Some versions of xterm do colors
and some do not. Same for other terminal emulators. I'd guess that on devices (whether physical or logical)
which DO do colors, it's likely to be done via escape sequences, which you can just interpolate into the
putput stream.
Good luck.
------------------------------
Date: Wed, 24 Jun 1998 22:18:47 +0100
From: "Col" <colin.riddle@scotmail.com>
Subject: Re: Date Calculation Problems.
Message-Id: <35916da3.0@news1.mcmail.com>
Thanks Larry
I've used the substr method and it's looking good. I love Perl :0)
Once again thanks.
--
Col
Colin Riddle
===============================================
colin.riddle@mcmail.com - http://www.col.mcmail.com/
colin@selectweb.co.uk - http://www.selectweb.co.uk/
icq : 1945235
===============================================
Larry Rosler <lr@hpl.hp.com> wrote in message
MPG.ffaf9f6c941311b9896c7@nntp.hpl.hp.com...
>In article <35915824.0@news2.mcmail.com>, Col <colin.riddle@scotmail.com>
>says...
>...
>> 1998122112:39:01
>>
>> is there any way that I can split this into different variables, eg $year
>> $month $day etc. I know that you can split things on certain preset
>> separators eg splitting on &'s or \'s or something, but is it possible to
>> spilt on a number of characters?
>
>perldoc -f substr
>
>is best, though you *can* do it with a regex like /(....)(..) etc.
>
>--
>Larry Rosler
>Hewlett-Packard Laboratories
>http://www.hpl.hp.com/personal/Larry_Rosler/
>lr@hpl.hp.com
------------------------------
Date: 24 Jun 1998 20:56:34 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Flames....
Message-Id: <6mrp62$gu7$3@marina.cinenet.net>
T. Ames (ames0009@tc.umn.edu) wrote:
: On 24 Jun 1998 19:55:04 GMT, cberry@cinenet.net (Craig Berry) wrote:
:
: >: What is a helpdesk? Gee, I think it is a place where people go to get
: >: help.
: >
: >...with a paid employee behind the desk, and paying customers in front of
: >it. That's the critical difference.
:
: Money has nothing to do with it. It is a "mutual helpdesk." What
: many people seem to be forgetting is that no one is forcing anyone to
: answer anything! Some of us are merely pointing out that going out of
: your way to flame someone isn't very constructive and creates a
: hostile atmosphere.
Money is only one aspect of it. The point is, a voluntary association can
set standards, and handle 'outsiders', differently from a (successful)
business. Believe me, there were some customers on my various retail jobs
during high school and college whom I would gladly have kicked in the face
had they approached me in my private persona as they did while I was on
the job -- but I *was* on the job, and part of that five bucks an hour
said "You don't kick customers, no matter how stupid or rude they might
be." Of course, even there, I had the option of calling security and
having a truly offensive or disruptive person dragged out -- not a
possiblity here, alas.
This newsgroup has historically been a place for reasonably informed
discussions of Perl, governed by the generally accepted rules of
netiquette and operating at all levels from rank beginner to uber-guru.
Part of that culture has *always* been that contributors are expected to
come to the table having already done their homework. That's how this
voluntary association works, or at least *should* work in my view. It's
an aspect of our culture I will fight to avoid losing.
And as I've explained elsewhere today, I'm coming to feel that a 'hostile
atmosphere' (for those who post without heeding basic rules of netiquette)
is precisely what we should foster. To quote from _Young Frankenstein_,
"A riot is a very ugly thing...and I think we need one, right now."
[snip]
: Once again, money has nothing to do with it. The help is mutual - you
: yourself said that you both answer and ask questions -- isn't that a
: division of functions?
Not in the sense I'm using the term. This newgroup is a mutual give and
take. A helpdesk employee is not at liberty to decline to answer some
questions, nor is he able to demand reciprocal answers from customers.
The polarity is fixed.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Wed, 24 Jun 1998 21:36:11 GMT
From: ames0009@tc.umn.edu (T. Ames)
Subject: Re: Flames....
Message-Id: <35916f1a.16964924@news.tc.umn.edu>
On 24 Jun 1998 20:56:34 GMT, cberry@cinenet.net (Craig Berry) wrote:
>Money is only one aspect of it. The point is, a voluntary association can
>set standards, and handle 'outsiders', differently from a (successful)
>business. Believe me, there were some customers on my various retail jobs
>during high school and college whom I would gladly have kicked in the face
>had they approached me in my private persona as they did while I was on
>the job -- but I *was* on the job, and part of that five bucks an hour
>said "You don't kick customers, no matter how stupid or rude they might
>be." Of course, even there, I had the option of calling security and
>having a truly offensive or disruptive person dragged out -- not a
>possiblity here, alas.
>
Here is where the entire disagreement lies: some of us don't think
you should only be polite if you are being paid. "kicking someone in
the face" because they don't have as much knowledge on a particular
subject as you do seems a little barbaric to me.
>And as I've explained elsewhere today, I'm coming to feel that a 'hostile
>atmosphere' (for those who post without heeding basic rules of netiquette)
>is precisely what we should foster. To quote from _Young Frankenstein_,
>"A riot is a very ugly thing...and I think we need one, right now."
>
Has it worked so far? I think not. All it has done has generate
conversations like the one we are having now.
>[snip]
>: Once again, money has nothing to do with it. The help is mutual - you
>: yourself said that you both answer and ask questions -- isn't that a
>: division of functions?
>
>Not in the sense I'm using the term. This newgroup is a mutual give and
>take. A helpdesk employee is not at liberty to decline to answer some
>questions, nor is he able to demand reciprocal answers from customers.
>The polarity is fixed.
Once again, you make my point for me: you ARE at liberty to decline
to answer ANY question. I only wish some people would exercise this
liberty more frequently -- rather than going out of their way to
insult someone.
T. Ames
------------------------------
Date: Wed, 24 Jun 1998 21:37:29 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: foreach not reading array?
Message-Id: <Pine.GSO.3.96.980624142453.14091O-100000@user2.teleport.com>
On Wed, 24 Jun 1998, Michael S. Brito, Jr. wrote:
> Subject: foreach not reading array?
I'm not sure that this question has anything to with foreach, or even much
with an array.
> Why do I get this error when I run this script???? It sends the e-mail
> and make's it to the 'Location' line and spits out this error:
>
> mike... Recipient names must be specified
> /home/mike/dead.letter... Saved message in /home/mike/dead.letter
> Location:http://208.159.33.19/project/thanks.html
That looks like an error from your mail program; maybe you're not
interacting properly with it.
> open (MAIL, "|$mailprog $address") || die "Cant open $mailprog: $!\n";
It's generally a Bad Thing with respect to security to pass an email
address on the command line, since it may contain shell metacharacters and
yet still be a valid address. For example, what would your command line
say tell your machine to do if this were the address? (It's valid; feel
free to send it a test message via any standard mail program.)
fred" && echo gotcha "barney@redcat.com
Check your mail program's documentation for an option like sendmail's -t
option which can let you put the address elsewhere than on the command
line. Even if you know that today's addresses are safe, there's no telling
where you'll be asked to send mail tomorrow!
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 24 Jun 1998 15:37:27 -0500
From: "His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated" <xenophon@irtnog.org>
Subject: Re: Have we got a good free Perl manual?
Message-Id: <w4obtriwn7c.fsf@irtnog.org>
>>>>> "ML" == Mark Lehrer <mark@satch.markl.com> writes:
ML> What is the URL? I have seen three responses now, none with
ML> how to find it. I especially need documentation on how to
ML> link in a .a with the perl executable.
What they're trying to get at is that Perl comes with a complete set
of manual pages (and very well written documentation at that---I've
never read either of the print books, just the man pages, and I seem
to be able to get what I want done done in Perl), which are presumably
distributed on the same terms as Perl itself.
--
Rev. Dr. Xenophon Fenderson, the Carbon(d)ated, KSC, DEATH, SubGenius, mhm21x16
Pope, Patron Saint of All Things Plastic fnord, and Salted Litter of r.g.s.b
"What shall it profit a man if he should gain the world and lock his keys
in the car before he can get it home?" --Gwendoly Piper in alt.slack
------------------------------
Date: Wed, 24 Jun 1998 21:22:55 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Looking for Perl Application, PLEASE HELP
Message-Id: <Pine.GSO.3.96.980624142240.14091N-100000@user2.teleport.com>
On Wed, 24 Jun 1998, Karl M. Joch wrote:
> does somebody know a freeware or shareware written in perl witch i can use
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 24 Jun 1998 20:59:26 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: NEwbie question: how do I find string length?
Message-Id: <slrn6p2q8l.2t9.gabor@localhost.vmunix.com>
In comp.lang.perl.misc, Al Wang <alwang@oculus.lvl.pri.bms.com> wrote :
# Hi all,
#
# I was wondering if there is any builtin function in Perl for returning
# the length of a string. If not, what's the most efficient way to do
# this?
Your question is also your answer. Look for the quite appropriately
named operator 'length'.
------------------------------
Date: Wed, 24 Jun 1998 21:15:50 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Searching through a file
Message-Id: <Pine.GSO.3.96.980624141435.14091M-100000@user2.teleport.com>
On Wed, 24 Jun 1998, HU wrote:
> open (fIfile, $sIfile);
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
> while(<fIfile>)
> {
> chomp();
> if (/\n*.\(*.\)*\n\{/)
You're reading a line at a time, then you're removing the newline. That's
good, but it means that \n isn't likely to ever be found in that string at
this point.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 24 Jun 1998 21:03:29 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: string substitution
Message-Id: <Pine.GSO.3.96.980624135437.14091J-100000@user2.teleport.com>
On Wed, 24 Jun 1998, Stan Towianski wrote:
> Someone helped me with this problem once. Here is what I do:
>
> $match = "reg(3)";
> $change_to = "xxx";
> $line = "reg(3)+bus";
> $evalstring = '$newstring =~ ' . "s/$match/$change_to/ig"
> ;
Uh oh. You're not going to use eval STRING are you? Imagine that
$change_to might include a slash, or $match might have parentheses. Oh,
wait - $match _does_ have parentheses. :-)
> eval( $evalstring ); # Added quotemeta operator \Q, allow change
> to $_
I'm not sure what that comment is saying; I didn't see anywhere that \Q
was used.
Of course, you could have (and should have) done that substitution, with
\Q added, outside of the eval. Not only would it be much shorter code, but
it would do the right thing. :-)
eval of a string is rarely needed in modern Perl programs. And since in
this case it doesn't do anything you can't do more easily without it, it's
certainly best to be avoided. If you ever do have a real reason to use
eval STRING, don't forget to check $@ afterwards.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 24 Jun 1998 21:09:13 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: system() and security again
Message-Id: <6mrptp$b12$3@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
cadams@ro.com (Chris Adams) writes:
:Which manpage would that be? The current version from CPAN is
:http://www.perl.com/CPAN/src/5.0/perl5.004_04.tar.gz, and that does not
:docuemnt anything like what you have above.
The one in the developer release, which I've been maintaining. :-)
As I've explained elsewhere.
--tom
--
Doing linear scans over an associative array is like trying to club someone
to death with a loaded Uzi. --Larry Wall
------------------------------
Date: 24 Jun 1998 17:05:16 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: What a Crappy World (oh, yes!)
Message-Id: <ltsokubjeb.fsf@asfast.com>
hex@voicenet.com (Matt Knecht) writes:
> Olga <katzman@students.uiuc.edu> wrote:
> >It's great to hear that moeny is not a concern to you, and that you do
> >this for fun, but the people you are insulting are truly not having too
> >much fun. In fact they are afraid to post any more questions to the
> >newgroups because of your ( and some other poeple's insults).
>
> This is _exactly_ what many people are trying to accomplish with terse
> referals to the FAQ and documentation. I'm sure they will all be glad
> to hear it's working. I know I am.
I have no objection to terse referrals. What I object to are the
insults (sometimes gratuitously verbose) that a few people here
compose to go along with the terse referrals to the docs.
People who pose unwanted questions will go to the docs just as readily
if they are steered in that direction nicely, rather than insultingly.
An added benefit of these polite pointers to the docs is that the
newsgroup then will not contain as many irate comments from those
who have been insulted.
> [ ... ]
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: Wed, 24 Jun 1998 21:13:12 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: What a Crappy World (oh, yes!)
Message-Id: <IZdk1.41$t32.610087@news2.voicenet.com>
Scratchie <upsetter@ziplink.net> wrote:
>Big deal. If you politely show him an easier way to get an answer (than
>Usenet) he probably won't post inappropriately again, either (see Tom
>Phoenix's posts for an example).
I don't want to have to break this to you, but, the world is not a
polite place. People generally aren't polite. And, usenet is generally
not polite. I don't think this is a bad thing. If you're trying to
change the attitude of the world so everybody is always smiling, no
matter their level of frustration with the inane, you're going to drive
people to insanity.
I don't want to live in a Stepford world where everything is saccarine
and polished with the insides rotting out. People get angry and
frustrated. While they should temper it, they should not mask it.
>But of course some people don't find that as satisfying as a well-penned
>put-down.
I still don't find this to be true. Most of the posts, even if they
include flames, are meant to instruct and redirect, not to _just_
belittle.
--
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"
------------------------------
Date: 24 Jun 1998 17:09:32 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: What a Crappy World (oh, yes!)
Message-Id: <ltpvfybj77.fsf@asfast.com>
hex@voicenet.com (Matt Knecht) writes:
> Olga <katzman@students.uiuc.edu> wrote:
> >So why not let these newbie people decide what they need.
>
> Because they don't know what they need. This is exactly the type of
> post that gets what you would call a flame. What they need is to look
> at the docs and the FAQ, not a simple answer. A clueless post reveals
> much more than the author has intended, and since there are _excellent_
> teachers here, they see it, and get those people out of this newsgroup,
> and back to the documentation where they belong (Sometimes, they get
> sent back to look at programming ideas, not just Perl).
They are excellent teachers if they get people out of the newsgroup
and over to the docs without resorting to childish insults. They are
poor teachers if they don't know how to make use of human decency when
pointing people out of the newsgroup and towards these excellent
resources.
> [ ... ]
>
> Should they? The straightest answers out there is in the docs and FAQ.
> Not in this newsgroup.
A straight answer is fine. A not-so-straight answer that also contains
one or more insults is uncalled for.
> [ ... ]
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: 24 Jun 1998 21:38:59 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: What a Crappy World (oh, yes!)
Message-Id: <6mrrlj$j67@fridge.shore.net>
Matt Knecht <hex@voicenet.com> wrote:
: I don't want to have to break this to you, but, the world is not a
: polite place. People generally aren't polite. And, usenet is generally
: not polite.
Gee, thanks for the update. I had never noticed this before.
: I don't think this is a bad thing.
Some of us think that society (to say nothing of usenet) could be made
more polite, and that that would be a good thing. I enjoy reading a good
flame war from time to time, but around here it's all flame, no war.
: If you're trying to
: change the attitude of the world so everybody is always smiling, no
: matter their level of frustration with the inane, you're going to drive
: people to insanity.
That was never my intention.
: I don't want to live in a Stepford world where everything is saccarine
: and polished with the insides rotting out.
Neither do I, and I never advocated such.
: People get angry and
: frustrated. While they should temper it, they should not mask it.
Some people around here do neither. Instead of treating newbies with any
kind of respect, they insult their intelligence, motivation and/or
operating system.
:>But of course some people don't find that as satisfying as a well-penned
:>put-down.
: I still don't find this to be true. Most of the posts, even if they
: include flames, are meant to instruct and redirect, not to _just_
: belittle.
Most? Perhaps... I haven't done a statistical analysis on them. But
certainly not all.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: 24 Jun 1998 17:00:07 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: What a Crappy World
Message-Id: <ltvhpqbjmw.fsf@asfast.com>
> Lloyd, are you of the opinion that this newsgroup exists for the
> express purpose of helping people who don't read manpages?
No.
> That it's a Perl Beginners Free Helpdesk?
No.
> Are you sure you want to support that position?
Since I don't agree with either of these assertions, I certainly
wouldn't want to support them.
I thank you for asking these questions, however, because it shows me
that I have not been clear in expressing what I *do* stand for in this
debate. I will explain my position in two different ways in hopes
that I can then be more successful at making it clear.
Explanation 1
-------------
Many people here (including myself, by the way), believe that it's
important that people who pose frequently asked questions be steered
to the excellent documentation that you and others have so selflessly
toiled over. Some of these people have also taken it upon themselves
to educate these novices about the following items:
-- That their questions are FAQ's.
-- That excellent documentation exists which answers their questions.
-- That this newsgroup would be even more cluttered with noise than
it currently is if frequently asked questions were routinely and
repeatedly posed and answered here.
-- That some of the questions posed by novices are better answered in
other, more topical forums.
[ Note that nowhere in this list did I mention anything about
providing novices with technical help about Perl itself. ]
The following statements illustrate two ways that people here tend to
provide this education to "newbies":
Statement A: "You and others like you are similar to a swarm of
flies, and you infest this newsgroup with your
incessant, moronic, freeloading questions. Go away
and don't come back until you have learned how to
behave here."
Statement B: "Your question is one that's frequently asked here,
and there is a lot of excellent, free documentation
that covers this and many other questions you might
have. In order to keep this newsgroup uncluttered
with repeated answers to these kinds of questions,
we ask you to please check out this documentation,
which we believe will help you immensely not only
with this question, but with many others you may
have, as well."
Note that Statement A and Statement B each pursue the same goal of
persuading people to go to the documentation, to not clutter the
newsgroup, etc. However, Statement A is insulting and childish, while
Statement B is respectful and more mature.
My goal has been to try to persuade those who have taken it upon
themselves to teach people about going to the docs and not cluttering
the newsgroup to try to express themselves more in the manner of
Statement B, not Statement A. As a case in point, Tom Phoenix is
doing an excellent job of this, and I encourage all of you who are
trying to educate "newbies" in this way to follow his example.
Explanation 2
-------------
Consider this diagram:
Encouraging people Providing lots of
to go to the docs; free help to all
encouraging self- who ask questions
sufficiency
+=================================================+
Treating | |
people with | [ A ] [ Me ] [ E ] |
politeness | |
and respect | |
| |
| |
Insulting | |
and berating | [ B ] [ C ] [ D ] |
people | |
+=================================================+
Many people believe it's best to stay on the left-hand side of this
diagram. To these people: I encourage you to try to stay in the
upper-left-hand corner, and to not stray down towards the
lower-left-hand corner.
I like to try to stay, as much as possible, in the location depicted
by "Me" in the above diagram. Certain other people are further to the
left ("A" in the diagram ... this appears to me to be more or less
where Tom Phoenix falls, for example).
I am trying to address those people at positions "B", "C", and "D" and
to encourage them to move their vertical positions higher in this
diagram, while not changing their horizontal positions at all.
In my experience, the people I want to focus my attentions on the most
are people who fall between the "B" and "C" positions, since there
seem to be very few people who are c.l.p.m "gurus" and regulars who
fall close to "D".
I don't know of any c.l.p.m "gurus" or regulars who fall all the way
over at position "E", either, although please correct me if I missed
someone.
Anyway, I hope that these two explanations have better clarified my
position.
--
Lloyd Zusman
ljz@asfast.com
God bless you.
------------------------------
Date: 24 Jun 1998 20:57:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: What a Crappy World
Message-Id: <6mrp7l$b12$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
dbwhite@btv.ibm.com writes:
:
:Programming Perl, Second Edition talks about Usenet newsgroups on page
:xv, and in the sentence that refers to clpm, states "no question is
:too silly to ask." That conveys carte blanche to ask anything; no
:intelligence required.
Funny how times have changed since the <POST> button was given
to AOLers running DOS.
--tom
--
"New versions happen." --Larry Wall
------------------------------
Date: Wed, 24 Jun 1998 21:17:23 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: What a Crappy World
Message-Id: <D1ek1.42$t32.610087@news2.voicenet.com>
Michael J Gebis <gebis@albrecht.ecn.purdue.edu> wrote:
>Somebody (from ignorance, laziness, apathy, malice) posts a question
>which is answered elsewhere or is otherwise inappropriate. Go ahead
>and flame the SOB. BUT DON'T DO IT ON THE NEWSGROUP. Why the hell
>should I have to read not only the original (useless to me) question,
>but also the (useless to me) answer. It's bad enough to see "RTFAQ"
>dozens of times, without someone posting in a way guaranteed to ignite
>a flame war.
Why is this even an issue? You seem like a technically saavy person.
Just killfile the thread when you see a newbie question, and you won't
have to endure the responses. If both the issue, and reply are useless
to you, you lose nothing except lost time.
--
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"
------------------------------
Date: 24 Jun 1998 21:15:32 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: What a Crappy World
Message-Id: <6mrq9k$hau@fridge.shore.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: [courtesy cc of this posting sent to cited author via email]
: The inability to run a simple search in a textfile or ten is
: a crippling disability, what which probably disqualifies one
: from programming altogether.
Not all questions are answerable by a simple text search. For example,
it's tough to look up the docs for a particular function if you don't know
its name.
--Art
PS: There's no reason I can think of for you to send email to an account
that you won't accept email from.
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: 24 Jun 1998 21:41:26 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: What a Crappy World
Message-Id: <6mrrq6$j67@fridge.shore.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: :Programming Perl, Second Edition talks about Usenet newsgroups on page
: :xv, and in the sentence that refers to clpm, states "no question is
: :too silly to ask." That conveys carte blanche to ask anything; no
: :intelligence required.
: Funny how times have changed since the <POST> button was given
: to AOLers running DOS.
Yeah, but the blue Camel was published in September of 1996, well after
the floodgates had opened.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: Wed, 24 Jun 1998 20:57:40 GMT
From: jhildeb2@my-dejanews.com
Subject: WIN32::ODBC
Message-Id: <6mrp84$i3h$1@nnrp1.dejanews.com>
I have searched all over my documentation, the usernet, and the web but I
can't seem to find an answer for my question so hopefully someone here can
help me.
I am using Dave Roth's WIN32::ODBC package with ActiveState's build 316 of
Perl for WIN32. The program I am writing opens up multiple ODBC connections
to an Microsoft SQL server (version 6.0 if that matters). In an error
situation I would like to be able to close all my open ODBC connections
before ending the program. Using the Connection() function I can get a list
of all the connection numbers of my open connections but the Close() function
needs to be referenced using an ODBC Connection object (e.g. $db->Close()).
I can't seem to find a way to translate a connection number into a connection
object. Does anyone have any ideas?
Thanks
Jim Hildebrand
Novice Perl programmer
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 24 Jun 1998 21:37:01 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Would someone tell me what this means?
Message-Id: <35917319.3A38@min.net>
Rich Bowen wrote:
>
> For the record, the code is from wwwboard by Matt Wright, which is in
> use on hundreds of web sites around the world.
Yeah, and millions of people use crapware like MS Windows.
Popular != Good.
Maybe Matt's stuff might be a starting point, but maybe your time
would be better invested writing your own stuff from scratch.
(Well, not from scratch: use CGI.)
--
John Porter
------------------------------
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 2969
**************************************