[16592] in Perl-Users-Digest
Perl-Users Digest, Issue: 4004 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 13 21:05:24 2000
Date: Sun, 13 Aug 2000 18:05:12 -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: <966215112-v9-i4004@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 13 Aug 2000 Volume: 9 Number: 4004
Today's topics:
Re: can't read file handle (Abigail)
Re: Convert URLs to links (Abigail)
Re: Convert URLs to links (Abigail)
Re: Convert URLs to links <christopher_j@uswest.net>
Re: Convert URLs to links (Abigail)
Re: create process on windows platform (Abigail)
Re: Get the Time (Abigail)
Re: Get the Time (Abigail)
Re: how can I optimize a tied hash for speed <webqueen@my-deja.com>
Re: how can I optimize a tied hash for speed <webqueen@my-deja.com>
Re: lamer problem of commiting a perl script <danny@lennon.postino.com>
matching starting html code JonB9@aol.com
Re: matching starting html code <sungfung@yahoo.com>
Re: Negativity in Newsgroup -- Solution <uscphysics@hotmail.com>
Re: Negativity in Newsgroup -- Solution (Randal L. Schwartz)
Re: Negativity in Newsgroup -- Solution <care227@attglobal.net>
Re: Negativity in Newsgroup <uscphysics@hotmail.com>
Re: Negativity in Newsgroup <sumengen@hotelspectra.com>
Printing a Thread with HTML Lists <grichards@flashcom.net>
Re: Procmail vs Perl. <elephant@squirrelgroup.com>
Re: Procmail vs Perl. (Abigail)
Re: Procmail vs Perl. (Tony L. Svanstrom)
Re: ps on NT <sumengen@hotelspectra.com>
Re: rmdir works with Xitami/w95 but not with MS-IIS/NT (David Efflandt)
set variable to results of regex <glued2NOglSPAM@hotmail.com.invalid>
Re: set variable to results of regex (Jon B 9)
Re: set variable to results of regex <care227@attglobal.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Aug 2000 23:53:44 GMT
From: abigail@foad.org (Abigail)
Subject: Re: can't read file handle
Message-Id: <slrn8ped78.tj3.abigail@alexandra.foad.org>
Brian (mail@mail.com) wrote on MMDXXXVII September MCMXCIII in
<URL:news:39945D28.DE2D0093@mail.com>:
{}
{} When I step through the following snippet it skips the entire while
{} loop. However if, when I open it, I take out the input symbol by
{} rec.txt it moves through the while loop. (and of course can't print to
{} REC). Anybody ever had a problem like this before?
{}
{} open( REC, ">rec.txt" ) || die "Can't open rec.txt";
{} while(<REC>) {
If you use -w, modern Perls will warn you what's wrong.
You cannot read from a file handle that's opened for writing.
{} chomp;
{} if( $theLine eq $_ ) {
{} $_= join "", $_, $comment;
{} print REC $_;
{} }
{} }
{} close REC;
But fixing this to opening it for read/write isn't going to solve the
problem, as alternating reading/writing is going to make a huge mess.
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54"; s/<<EOT/<<EOT/e; print;
Just another Perl Hacker
EOT
------------------------------
Date: 14 Aug 2000 00:00:13 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Convert URLs to links
Message-Id: <slrn8pedjb.tj3.abigail@alexandra.foad.org>
Fernando (fm@via-rs.net) wrote on MMDXXXV September MCMXCIII in
<URL:news:8mqqn3$1qf2$1@phi.procergs.com.br>:
&& I want to write a regular expression that search if the user supplied a
&& url(http://anything.net or www.anything.com for example) in a texarea form
&& and convert it to a link.
&&
&& I tried the following:
&&
&& $string =~ s/(http:\/\/.+|www\..+)/<a href=$1>$1<\/a>/g;
URLs can be captured with regexes, but not the trivial one you tried.
Try this in stead:
$string =~ s<
(?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.
)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)
){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F
\d]{2}))|[;:@&=])*)(?:/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yy]=(?:[1-
9]\d*)))?)|(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~
:@/])+)(?:(?:;[Uu][Ii][Dd][Vv][Aa][Ll][Ii][Dd][Ii][Tt][Yy]=(?:[1-9]\d*
)))?(?:/;[Uu][Ii][Dd]=(?:[1-9]\d*))(?:(?:/;[Ss][Ee][Cc][Tt][Ii][Oo][Nn
]=(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~:@/])+)))?))
)?)|(?:nfs:(?:(?://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-
Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:
\.(?:\d+)){3}))(?::(?:\d+))?)(?:(?:/(?:(?:(?:(?:(?:[a-zA-Z\d\$\-_.!~*'
(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\-_.!~*'(),
])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))?)|(?:/(?:(?:(?:(?:(?:[a-zA-Z\d
\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\
-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?))|(?:(?:(?:(?:(?:[a-zA-
Z\d\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d
\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))
><<a href = "$1">$1</a>>gx;
That should do the trick.
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT
------------------------------
Date: 14 Aug 2000 00:03:07 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Convert URLs to links
Message-Id: <slrn8pedoq.tj3.abigail@alexandra.foad.org>
multiplexor (abuse@localhost.com) wrote on MMDXXXV September MCMXCIII in
<URL:news:8mrg81$cpn$1@horn.hk.diyixian.com>:
''
'' Expression: Starts with "http://" or "www." followed by optional non-space
'' characters.
Which would capture the wrong thing when someone uses:
<URL:http://www.perl.com/>
or
"http://www.perl.com"
'' Protocol and domain name are case-insensitive, as I know.
Actually, scheme names *aren't* case-insensitive. Although it's recommended
agents are lenient.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
------------------------------
Date: Sun, 13 Aug 2000 17:07:10 -0700
From: "Christopher M. Jones" <christopher_j@uswest.net>
Subject: Re: Convert URLs to links
Message-Id: <DKGl5.1101$3b6.247408@news.uswest.net>
Don't you have a hobby? Or at least a job?
"Abigail" <abigail@foad.org> wrote:
> $string =~ s<
> (?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.
> )*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)
> ){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F
> \d]{2}))|[;:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{
> 2}))|[;:@&=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{
> 2}))|[;:@&=])*))?)?)|(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?
> :%[a-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-
> fA-F\d]{2}))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\d*
> )))?(?:/;[Uu][Ii][Dd]=(?:[1-9]\d*))(?:(?:/;[Ss][Ee][Cc][Tt][Ii][Oo][Nn
> ]=(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[&=~:@/])+)))?))
> )?)|(?:nfs:(?:(?://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-
> Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:
> \.(?:\d+)){3}))(?::(?:\d+))?)(?:(?:/(?:(?:(?:(?:(?:[a-zA-Z\d\$\-_.!~*'
> (),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\-_.!~*'(),
> ])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))?)|(?:/(?:(?:(?:(?:(?:[a-zA-Z\d
> \$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d\$\
> -_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?))|(?:(?:(?:(?:(?:[a-zA-
> Z\d\$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*)(?:/(?:(?:(?:[a-zA-Z\d
> \$\-_.!~*'(),])|(?:%[a-fA-F\d]{2})|[:@&=+])*))*)?)))
> ><<a href = "$1">$1</a>>gx;
------------------------------
Date: 14 Aug 2000 00:50:25 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Convert URLs to links
Message-Id: <slrn8peghg.tj3.abigail@alexandra.foad.org>
Christopher M. Jones (christopher_j@uswest.net) wrote on MMDXL September
MCMXCIII in <URL:news:DKGl5.1101$3b6.247408@news.uswest.net>:
() Don't you have a hobby? Or at least a job?
No. And no either.
And don't post Jeopardy style.
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
------------------------------
Date: 14 Aug 2000 00:08:28 GMT
From: abigail@foad.org (Abigail)
Subject: Re: create process on windows platform
Message-Id: <slrn8pee2r.tj3.abigail@alexandra.foad.org>
u8526505@ms27.hinet.net (u8526505@ms27.hinet.net) wrote on MMDXXXVII
September MCMXCIII in <URL:news:8n0mel$igj@netnews.hinet.net>:
:) The fork function doesn't work on windows platform,at least on my computer.
:) Is there any other way to write multi-process code on windows?
:) I also tried the thread version of some samples and they all failed.
:) The message said no threads support but I think 5.6 should support thread.
:) I'm confused.
Perl 5.6 for windows supports fork(), which is simulated using threads.
But you need a thread enabled perl to do so.
Abigail
--
perl -Mstrict -we '$_ = "goto K.print chop;\n=rekcaH lreP rehtona tsuJ";K1:eval'
------------------------------
Date: 14 Aug 2000 00:16:33 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Get the Time
Message-Id: <slrn8peei0.tj3.abigail@alexandra.foad.org>
Kermit (as@if.com) wrote on MMDXXXVI September MCMXCIII in
<URL:news:RsCk5.138709$Gh.1990722@news20.bellglobal.com>:
## Just discovered how to get the time, hope this helps someone somewhere.
##
## $watch = time;
## $clock = localtime $watch;
##
## print $clock;
Wow! Impressive! I bet noone else figured this one out!
Abigail
--
perl -wlne '}print$.;{' file # Count the number of lines.
------------------------------
Date: 14 Aug 2000 00:22:17 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Get the Time
Message-Id: <slrn8peesp.tj3.abigail@alexandra.foad.org>
Tom Kralidis (tom.kralidis@ccrs.nrcan.gcDOTca) wrote on MMDXXXVI
September MCMXCIII in <URL:news:8musqo$qh13@nrn2.NRCan.gc.ca>:
~~
~~ When my watch breaks, I use:
~~
~~ perl -e 'print localtime(time) . "\n";'
Too much work.
perl -le'print$,.localtime'
or even
perl -le'print-localtime'
And just ignore the first character.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
------------------------------
Date: Sun, 13 Aug 2000 23:09:40 GMT
From: webqueen, queen of the web <webqueen@my-deja.com>
Subject: Re: how can I optimize a tied hash for speed
Message-Id: <8n79ri$pt2$1@nnrp1.deja.com>
In article <1efbcgl.1g90i0if6hxtsN%kpreid@attglobal.net>,
kpreid@attglobal.net (Kevin Reid) wrote:
> <webqueen> wrote:
>
> > I just benchmarked my ap thru CGI- 10,000 element hash going through
it
Thank-You Kevin, I'll give that one a go now!
HUG,
WQ
> > one item at a time, 4 minutes on a P450! Something like:
> >
> > tie %h ...
> >
> > foreach (keys %h) {do some simple sorting and printing}
> >
> > untie %h;
>
> That builds a list of every key in the hash, then iterates over it. It
> is much more efficient to use while and each():
>
> tie %h ...
> while (my ($key, $value) = each %h) {
> # do something with $key and $value
> }
> untie %h;
>
> --
> Kevin Reid: | Macintosh:
> "I'm me." | Think different.
>
--
Time is nature's way of preventing everything from happening at once.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 13 Aug 2000 23:41:37 GMT
From: webqueen, queen of the web <webqueen@my-deja.com>
Subject: Re: how can I optimize a tied hash for speed
Message-Id: <8n7bnh$rc5$1@nnrp1.deja.com>
Kevin:
I noticed that your approach was a few seconds fast up front- it took
off immediately. However in the big scheme of things it didn't make a
difference..
Thanks for the suggestion though. Anything is worth a try!
WQ
In article <1efbcgl.1g90i0if6hxtsN%kpreid@attglobal.net>,
kpreid@attglobal.net (Kevin Reid) wrote:
> <webqueen> wrote:
>
> > I just benchmarked my ap thru CGI- 10,000 element hash going through
it
> > one item at a time, 4 minutes on a P450! Something like:
> >
> > tie %h ...
> >
> > foreach (keys %h) {do some simple sorting and printing}
> >
> > untie %h;
>
> That builds a list of every key in the hash, then iterates over it. It
> is much more efficient to use while and each():
>
> tie %h ...
> while (my ($key, $value) = each %h) {
> # do something with $key and $value
> }
> untie %h;
>
> --
> Kevin Reid: | Macintosh:
> "I'm me." | Think different.
>
--
Time is nature's way of preventing everything from happening at once.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 14 Aug 2000 00:12:18 GMT
From: <danny@lennon.postino.com>
Subject: Re: lamer problem of commiting a perl script
Message-Id: <8n7dh2$13h$1@lennon.postino.com>
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.14-5.0 (i586))
Christopher M. Jones <christopher_j@uswest.net> wrote:
> "Abigail" <abigail@foad.org> wrote:
>> HD (elbereth*nospam*@gmx.de) wrote on MMDXXXV September MCMXCIII in
>> <URL:news:8mrjg7$6pp$1@news01.khis.de>:
>> ## I am starting in perl a few days ago
>> ##
>> ## #!/usr/bin/perl
>>
>> Bug 1: There's no -w.
>> Bug 2: There's no -T.
>> Bug 3: There's no "use strict;"
>> Bug 4: There's no "use CGI;"
> Sheesh, take the stick out of your ass for at least a
> few minutes a day. Not everyone needs to program like
> you do.
They are all valid criticisms. I have a wack of code that I have
written that is guilty of 2 and 3, and would give anything to
have had someone set me straight 2 years ago.
And while I am posting, thanks Abigail for the Algorithm::Numerical::Shuffle
module. I used it this week to do a job I thought would take all day in
about an hour. Cheers.
--
Danny Aldham Providing Certified Internetworking Solutions to Business
www.postino.com E-Mail, Web Servers, Web Databases, SQL PHP & Perl
------------------------------
Date: Mon, 14 Aug 2000 00:29:48 GMT
From: JonB9@aol.com
Subject: matching starting html code
Message-Id: <8n7ehq$t3c$1@nnrp1.deja.com>
how can i match all the code from <html> to <body ...>???
<html>[.\n]{0,}<head>[.\n]{0,}<\/head>[.\n]{0,}<body[.\n]{0,}>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 14 Aug 2000 00:44:16 GMT
From: sung <sungfung@yahoo.com>
Subject: Re: matching starting html code
Message-Id: <vjjepsg77msjh4b7n2kk418ombv95a51tl@4ax.com>
This should work:
/<html>(.*?)<\/html>/
On Mon, 14 Aug 2000 00:29:48 GMT, JonB9@aol.com wrote:
>how can i match all the code from <html> to <body ...>???
><html>[.\n]{0,}<head>[.\n]{0,}<\/head>[.\n]{0,}<body[.\n]{0,}>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
------------------------------
Date: Sun, 13 Aug 2000 22:10:04 GMT
From: "Ricky J. Sethi" <uscphysics@hotmail.com>
Subject: Re: Negativity in Newsgroup -- Solution
Message-Id: <01Fl5.7884$IH.292912@newsread2.prod.itd.earthlink.net>
Hello,
I just started following this thread, like many others I suppose, and was
struck by the truths and the untruths spoken by both sides. Rather than
entering the fray I propose a possible solution: why doesn't someone create
a comp.lang.perl.newbie newsgroup? Or, better still, newbies.* to serve as
a forum for beginners in everything everywhere? The only ones to frequent
such groups would be newbies and those eager to help them. Although I've
been around the Net for about 10 years, I rarely frequent the newsgroups so
please excuse my ignorance if such a solution already exists or is not
feasible. Still, food for thought...
Adios,
Rick.
------------------------------
Date: 13 Aug 2000 17:04:46 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Negativity in Newsgroup -- Solution
Message-Id: <m11yzs7lnl.fsf@halfdome.holdit.com>
>>>>> "Ricky" == Ricky J Sethi <uscphysics@hotmail.com> writes:
Ricky> why doesn't someone create a comp.lang.perl.newbie newsgroup?
And as we keep saying... there's NOTHING wrong with being a newbie HERE.
You just are expected to follow Usenet tradition:
1) read the group for a week or two before your first posting
2) be sure to do your homework before you post
3) recognize that this is not a help desk: it's volunteers that are doing
this for free because they *want* to help
If the "newbie" (a term which I would find offensive when I am one :)
just did these two things, they'd notice the meta-FAQ posting, and
notice that asking FAQ questions is likely to get curt responses, and
they'd fit in better.
But no, it doesn't happen. Whatever happened to the rule that you
read news.announce.newusers before your first post? It's so sad that
they make you take a test before you drive a car, but you can "drive"
all over Usenet without ever having touched the manuals!
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Sun, 13 Aug 2000 20:49:33 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Negativity in Newsgroup -- Solution
Message-Id: <3997421D.94F8C927@attglobal.net>
"Randal L. Schwartz" wrote:
>
>
> You just are expected to follow Usenet tradition:
>
> 1) read the group for a week or two before your first posting
one
>
> 2) be sure to do your homework before you post
two
>
> 3) recognize that this is not a help desk: it's volunteers that are doing
> this for free because they *want* to help
three
>
> If the "newbie" (a term which I would find offensive when I am one :)
> just did these two things
^^^
Methinks the Schwartz is growing weary.
------------------------------
Date: Sun, 13 Aug 2000 22:30:05 GMT
From: "Ricky J. Sethi" <uscphysics@hotmail.com>
Subject: Re: Negativity in Newsgroup
Message-Id: <NjFl5.7913$IH.291649@newsread2.prod.itd.earthlink.net>
<kevin+usenet@suberic.net> wrote in message
news:8n40dd$d03$1@localhost.ie.suberic.net...
> In article <LAel5.97336$A%3.1306866@news1.rdc2.pa.home.com>,
> Ben Kennedy <bkennedy99@home.com> wrote:
> >I bet I'm wasting my time again, but I have 15 minutes before lunch -
>
> you are. i've only read this newsgroup for a few days and it's rather
[SNIP]
> think of her as one of those annoying little dogs that runs barking to
> the fence, slams into it, runs back and then repeats over and over.
> you point and laugh at it, but you don't engage in conversations
> with it!
I'm still laughing at this image! Much truth was spoken in this post...
Ben, you seem like a standup guy; certainly you tried all that could be
asked of you but I'd suggest following Kevin's excellent advice. Methinks a
pint of guinness all around is definitely called for, eh?
Adios,
Rick.
------------------------------
Date: Sun, 13 Aug 2000 16:04:37 -0700
From: "Baris" <sumengen@hotelspectra.com>
Subject: Re: Negativity in Newsgroup
Message-Id: <39972922$1_2@goliath2.newsfeeds.com>
My experience is that perl has a very nice set of documentation, tutorials
and FAQ's, but no newcomer to perl expects this kind of documentation there.
People think that the FAQ's and documentation is just another stupid syntax
details pack. That was my idea of perl. So I end up bying bunch of books
(same way I did for every other language) and try to learn from them. But
then I noticed after several months that the FAQ is pretty damn good and
useful. It has more useful info than bunch of books I read.
Recently a friend of mine learned perl. I was trying to convince him to take
a look at the FAQ's or perl documentation, but other than function
references he didn't look at it at all. He insists that he has to buy a new
perl book everytime he wants to learn something about perl. He s coming from
C culture.
Baris.
"Steve Leibel" <stevel@bluetuna.com> wrote in message
news:stevel-1208000019160001@192.168.100.2...
> In article <39948FDD.8842C266@attglobal.net>, care227@attglobal.net wrote:
>
> > No one deserves an answer, straight or otherwise. That questions get
> > answered at all is a favor. You are asking for free advice from someone
> > who probably usually charges for such things. You are asking for their
> > time and their knowlege. And far too often, you (collectively, not
> > specifically) are unwilling to give back.
> >
>
> Wow, that is exactly the kind of attitude I'm talking about.
>
> I've gotten and given tons of free advice from people on the Net for
> years. It's an amazing medium. When I get stuck, I "ask the Net," and
> strangers always take time out of their day to share what they know. And
> from time to time a question runs across my screen that I know the answer
> to, and I pass along what I know.
>
> I reiterate that of all the newsgroups and mailing lists I've ever been
> on, comp.lang.perl.misc is the one place where every question is evaluated
> in terms of "Are they worthy enough to deserve an answer?" and generally
> found lacking. People on this group consistently go out of their way to
> demean questioners for not having done sufficient research (in the
> responder's opinion) or else point to very general documentation ("perldoc
> everything") rather than give a simple straightforward answer. The
> general tone is that of irritation at having to be bothered addressing an
> inferior life form.
>
> What's strange about this collective snottiness is that it comes out of
> the Perl community. I started with Perl4 using what eventually became a
> very-well-thumbed-through first edition Camel book. What I liked about
> the "Perl philosophy," or maybe the Perl sensibility, was "There's more
> than one way to do it." I always took that to indicate a laid-back, let's
> get the job done kind of attitude. Maybe you use a clever regexp while I
> use a few not-as-clever lines of code to accomplish the same result. But
> we're not going to fight over which approach is "better." We both got the
> job done, and there's more than one way to do it.
>
> I was away from Perl for a while doing C++ and Java, and now the past few
> months I'm on a big Perl5 project. So I'm coming up to speed on the new
> syntax and working through Damian Conway's "Object-Oriented Perl" and
> reading this newsgroup, and man I am really surprised by the tone of this
> group, which was not nearly so unfriendly a few years ago.
>
> Not everybody needs or wants to know every last detail of every last piece
> of Perl syntax. And by the way if you haven't noticed, Perl has gotten
> some very baroque (Larry likes that word) syntax lately. It's a fulltime
> job keeping up with the changes to the language. I caught a little of the
> the ANSI Perl discussion, and as I understand it the Perl powers that be
> prefer to keep adding features rather than try to standardize and
> stabilize what's already there. So it's very reasonable that a lot of
> programmers ask questions around here because they do not have the time or
> inclination to track every permutation of the language, and where else
> would they ask? This is where the experts hang out. And for those of you
> who love Perl passionately and want to promote its use, why not take the
> opportunity to answer the questions, and impress people with the openness
> and helpfulness of the community at the same time?
>
> I do take your point that this is a "discussion group" and not a help
> line. But jeez, it's Usenet. Of course people ask questions. What's
> different about this group is how difficult it is to get an answer, and
> the attitude that you have to wade through to get one.
>
> I challenge everyone in this newsgroup to stop for a moment the next time
> you're going to say "read the FAQ" or "Perldoc irrelevant" to an earnest
> question, and either A) Give a straightforward specific complete
> professional answer, like you would if your professional colleague was
> asking you the question; or B) Don't say anything at all.
>
> Do you really think that would be such a threat to the Perl world?
>
> Respectfully,
>
> Steve Leibel
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Sun, 13 Aug 2000 16:21:04 -0700
From: "Gabe" <grichards@flashcom.net>
Subject: Printing a Thread with HTML Lists
Message-Id: <speb6un7n4t170@corp.supernews.com>
I feel like an idiot. I've been working on this for way too long. How can I
print a threaded conversation using unordered HTML lists (<ul>). I can't
come up with an algorithm that does it properly. Everything I try gets it
skewed one way or another. When to print the <ul>'s is easy, I can't figure
out how to print the right number of </ul>'s at the right places. Here's
the code I'm using.
$content{'main'} .= qq{
<h2>Message Board</h2>
<h3>Messages</h3>
<ul>\n
};
my (%msgs, %children);
while (my @row = $getmsgs->fetchrow_array) {
my ($id, $pid, $subject, $name) = @row;
$msgs{$id}{parent} = $pid;
$msgs{$id}{subject} = $subject;
$msgs{$id}{name} = $name;
push(@{$children{$pid}}, $id);
}
my $pid = 0;
foreach (@{$children{$pid}}) {
Thread($_);
}
sub Thread {
my $id = shift;
if (exists $children{$id}) {
$content{'main'} .= qq{<li>$msgs{$id}{subject}\n};
$content{'main'} .= qq{<ul>\n};
foreach (@{$children{$id}}) {
Thread($_);
}
}
else {
$content{'main'} .= qq{<li>$msgs{$id}{subject}\n};
}
}
$content{'main'} .= '</ul>';
PrintPage(\%content, $template, $dbh);
------------------------------
Date: Sun, 13 Aug 2000 23:04:07 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Procmail vs Perl.
Message-Id: <MPG.1401c6cc2a636da19896ad@localhost>
Tony L. Svanstrom wrote ..
>Sam <sam@email-scan.com> wrote:
>
>> In article <1efbf1y.171gvyotw70ytN%tony@svanstrom.com>,
>> tony@svanstrom.com (Tony L. Svanstrom) writes:
>>
>> > A simple question: Why would I want to learn how to use procmail when I
>> > already know Perl, wouldn't it be easier, as well as potentially a lot
>> > more powerful, to simply use Perl for the mailfiltering?
I don't seem to have your original post here - so excuse this thread
breaker
your question was asked and answered by Simon Cozens in the latest TPJ
.. he created Mail::Audit which is on CPAN .. well worth a look
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 13 Aug 2000 23:49:54 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Procmail vs Perl.
Message-Id: <slrn8ped01.tj3.abigail@alexandra.foad.org>
jason (elephant@squirrelgroup.com) wrote on MMDXXXIX September MCMXCIII
in <URL:news:MPG.1401c6cc2a636da19896ad@localhost>:
?? Tony L. Svanstrom wrote ..
?? >Sam <sam@email-scan.com> wrote:
?? >
?? >> In article <1efbf1y.171gvyotw70ytN%tony@svanstrom.com>,
?? >> tony@svanstrom.com (Tony L. Svanstrom) writes:
?? >>
?? >> > A simple question: Why would I want to learn how to use procmail when I
?? >> > already know Perl, wouldn't it be easier, as well as potentially a lot
?? >> > more powerful, to simply use Perl for the mailfiltering?
??
?? I don't seem to have your original post here - so excuse this thread
?? breaker
??
?? your question was asked and answered by Simon Cozens in the latest TPJ
?? .. he created Mail::Audit which is on CPAN .. well worth a look
I looked, I read its limitations, I decided to stay with procmail.
I do have a Perl program to modify the .procmailrc for me though.
Abigail
--
sub A::TIESCALAR{bless\my$x=>A};package B;@q[0..3]=qw/Hacker Perl
Another Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
$y=>B}; tie my $shoe => qq 'A';print "$shoe $shoe $shoe $shoe\n";
------------------------------
Date: Mon, 14 Aug 2000 01:53:16 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Procmail vs Perl.
Message-Id: <1efbzgo.19a6hzof86o9qN%tony@svanstrom.com>
Alan J. Flavell <flavell@mail.cern.ch> wrote:
> On Sun, 13 Aug 2000, Tony L. Svanstrom wrote:
>
> > Ah, now we're getting to the interesting stuff... Exactly what is it
> > that Procmail is doing that I can't do with Perl, when it comes to
> > writing to the mailbox?
>
> It knows a whole lot about different kinds of mailbox and different
> locking strategies. If you toss out procmail, you'd have to re-invent
> those. Well, at least you'd have to re-invent the ones you need - and
> if/when you move to a different environment you'd likely have to do it
> over again.
Any reason why I should wrap procmail around my Perl script instead of
using mail.local?
> (So why not use procmail to pipe the stuff into your Perl script, and get
> the best of both?)
I'll do something like that, and if people are interested then I'll keep
y'all updated and put the whole thing online for others to download.
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82 78A6 647F F247 9363 F1DB
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©1999 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Sun, 13 Aug 2000 15:46:23 -0700
From: "Baris" <sumengen@hotelspectra.com>
Subject: Re: ps on NT
Message-Id: <399724da$1_2@goliath2.newsfeeds.com>
Thanks a lot.
It looks like a solution to my problem. I tried to go to the website in your
code:
http://www.microsoft.com/management/wmi
But this page doesn't exist anymore.
Thanks,
Baris.
"H C" <carvdawg@patriot.net> wrote in message
news:39959068.A11945C5@patriot.net...
> I've attached a script called "wmi.pl". I wrote it to demonstrate the use
of
> Microsoft's
> WMI classes and Perl on NT.
>
> To run the script on NT, you need to install the WMI classes from
> Microsoft...it's not a
> huge download.
>
> The script also demonstrates how to retrieve other info, as well. I have
a
> separate script
> to pull the EventLogs from remote systems using WMI....
>
> Carv
>
> Baris wrote:
>
> > Hello,
> > Inside my perl program I want to be able to get the current process list
on
> > winNT . On unix I am doing:
> > @list = `ps -e`;
> > (which probably is not the best way to do it. I am open to suggestions).
> > On windows I want to access the same list, but probably with a native
perl
> > function since it looks like there is no system command similar to ps. I
> > looked at Win32::xxx modules at Activestate, but I am not sure if any of
> > them is doing this.
> > Any ideas?
> > Thanks,
> > Baris.
> >
> > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> > -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
>
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Mon, 14 Aug 2000 00:39:01 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: rmdir works with Xitami/w95 but not with MS-IIS/NT
Message-Id: <slrn8pefso.fik.efflandt@efflandt.xnet.com>
On Sun, 13 Aug 2000 20:01:09 GMT, bjg <bGhassemlou@home.com> wrote:
>My developped several Perl programs and it was tested and was working under
>xitami webserver/Win95. Now I am installing the same code under
>MS-IIS/Win-NT and rmdir does not work any more and does not remove the
>corresponding directory
>hereis the code!
>can anyone help?
>
>Thanks for suggestions.
This is not a Perl question or problem. You cannot print anything else to
STDOUT before doing a (CGI.pm) redirect, and you are, so of course it
would not be expected to work with any proper web server. Apparently
xitami does not validate headers very well.
>opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
>$thisfile = readdir(DIR);
>print "Deleting:$some_dir/$thisfile,***\n";
>while( $thisfile ne '' ) {
> print "Deleting:$some_dir/$thisfile,***\n";
> if ($thisfile ne '.' && $thisfile ne '..' ){
> if ( unlink("$some_dir/$thisfile") > 0) {
> print "delted:$thisfile ,".' unlink('." $some_dir/$thisfile )" }
> else {
> print "failed:$thisfile ,".' unlink('." $some_dir/$thisfile )" }
> }
> $thisfile = readdir(DIR);
> }
>closedir(DIR) ;
>rmdir($some_dir);
>
>P.S.
>also have problem with:
>
> -d $subdir It does not yield true when checking on a subdirectory?
>
>
>
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Sun, 13 Aug 2000 16:47:24 -0700
From: glued2 <glued2NOglSPAM@hotmail.com.invalid>
Subject: set variable to results of regex
Message-Id: <057c3986.d349978f@usw-ex0104-028.remarq.com>
Admitted perl novice here...
I have a reg exp that extracts a string from between two
matching patterns when reading a file .... it works, I can print
it:
while (<SF>){
print if /$STARTPATTERN/ .. /$ENDPATTERN/ ;
}
Instead of printing the results (to the screen in this case;
it's a cgi script), I want to set a variable to equal the string
in between the patterns.... but I cannot figure out how... it's
gotta be one of those simple fundamentals that I just don't know
(yet).
-------------------------------
http://www.GluedToTheScreen.com
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 14 Aug 2000 00:21:18 GMT
From: jonb9@aol.com (Jon B 9)
Subject: Re: set variable to results of regex
Message-Id: <20000813202118.19739.00000116@ng-fr1.aol.com>
until you make a new search pattern, $& will contain your match.
------------------------------
Date: Sun, 13 Aug 2000 20:51:08 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: set variable to results of regex
Message-Id: <3997427C.2D29F58C@attglobal.net>
Jon B 9 wrote:
>
> until you make a new search pattern, $& will contain your match.
And using it will exact a large perfomance penalty... Better would
be to use capturing parens and then assign the value of $1 to the
desired variable.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4004
**************************************