[16011] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3423 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 19 18:06:34 2000

Date: Mon, 19 Jun 2000 15:05:21 -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: <961452320-v9-i3423@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 19 Jun 2000     Volume: 9 Number: 3423

Today's topics:
        [ Regexp ] Curious Behaviour of " last if /(match)/ " <TheEx0rcist@fanclub.org>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <tony_curtis32@yahoo.com>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <TheEx0rcist@fanclub.org>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <rootbeer@redcat.com>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <sariq@texas.net>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <TheEx0rcist@fanclub.org>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <TheEx0rcist@fanclub.org>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <care227@attglobal.net>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <care227@attglobal.net>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <stephen@twocats.dont-spam.demon.co.uk>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <lr@hpl.hp.com>
    Re: [ Regexp ] Curious Behaviour of " last if /(match)/ <TheEx0rcist@fanclub.org>
    Re: ANSI Perl: No Way !!! <dmeyers@panix.com>
    Re: Anyone use ActivePerl on Win95 or Win98 <hedim@hta-bi.bfh.xxx>
    Re: arp cache (Brandon Metcalf)
    Re: Bot for this group to auto-answer queries? lvirden@cas.org
    Re: Bot for this group to auto-answer queries? <dan@tuatha.sidhe.org>
    Re: Crazy enough that it might just work... <henry@penninkilampi.net>
    Re: Crazy enough that it might just work... <henry@penninkilampi.net>
    Re: Crazy enough that it might just work... (John Stanley)
    Re: Crazy enough that it might just work... (John Stanley)
    Re: Crazy enough that it might just work... (David H. Adler)
    Re: Crazy enough that it might just work... (Brandon Metcalf)
        du perl trial - recursive neverending loop occurs (Mike)
    Re: du perl trial - recursive neverending loop occurs <rootbeer@redcat.com>
        embedded ActivePerl 5.6 GUI code demo? <ryan.w.tanner@tek.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 19 Jun 2000 21:26:12 +0200
From: "TheEx0rcist" <TheEx0rcist@fanclub.org>
Subject: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <8ils5i$2lal$1@news4.isdnet.net>

Hi,

I am trying to retrieve the first occurence of "match" in the file $file :

--
open (FILE,"$file") or die "$file : $!";
    while (<SDJ>) {
        last if /(match)/;
    };
close (FILE);
print $1;
--

However I don't know why but as soon as the loop is exited, the matched
pattern : $1 becomes empty (!)
So the only work-around that I have found is to do :

--
open (FILE,"$file") or die "$file : $!";
    while (<SDJ>) {
        if (/(match)/) {
            $matched = $1;
            last;
        };
    };
close (FILE);
print $last;
--

Can anyone explain why in the first case, $1 comes empty?

Thanks in advance!

--
TheEx0rcist





------------------------------

Date: 19 Jun 2000 14:31:33 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <878zw1tqlm.fsf@limey.hpcc.uh.edu>

>> On Mon, 19 Jun 2000 21:26:12 +0200,
>> "TheEx0rcist" <TheEx0rcist@fanclub.org> said:

> Hi, I am trying to retrieve the first occurence of
> "match" in the file $file :

> open (FILE,"$file") or die "$file : $!";
> while (<SDJ>) { ...

> open (FILE,"$file") or die "$file : $!";
> while (<SDJ>) { ...

Neither example does anything useful because the
filehandle is FILE, not SDJ.

hth
t
-- 
"Trying is the first step towards failure"
                                           Homer Simpson


------------------------------

Date: Mon, 19 Jun 2000 22:05:18 +0200
From: "TheEx0rcist" <TheEx0rcist@fanclub.org>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <8iluet$2n5g$1@news4.isdnet.net>


> Neither example does anything useful because the
> filehandle is FILE, not SDJ.



Sorry stupid typo (bad copy / paste)

please replace <SDJ> by <FILE>

Thanks :-)




------------------------------

Date: Mon, 19 Jun 2000 13:28:25 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <Pine.GSO.4.10.10006191321580.29843-100000@user2.teleport.com>

On Mon, 19 Jun 2000, TheEx0rcist wrote:

> Can anyone explain why in the first case, $1 comes empty?

Besides the obvious bug in your program, it's worth looking at the perlvar
manpage which - at least in recent incarnations - says that variables like
$1 "are all read-only and dynamically scoped to the current BLOCK." This
is a feature, not a bug, in case you're wondering. :-)

Okay, before someone asks, here's why:

    s/(.)(.)/ &some_sub($1) . &some_sub($2) /ge;

Now imagine that &some_sub() does a pattern match of its own. Ouch!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Mon, 19 Jun 2000 15:30:16 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <394E82D8.41E2722D@texas.net>

TheEx0rcist wrote:
> 
> Hi,
> 
> I am trying to retrieve the first occurence of "match" in the file $file :
> 
> --
> open (FILE,"$file") or die "$file : $!";
>     while (<SDJ>) {
>         last if /(match)/;
>     };
> close (FILE);
> print $1;
> --
> 
> However I don't know why but as soon as the loop is exited, the matched
> pattern : $1 becomes empty (!)

Learn to use the documentation that comes with the Perl distribution.

This behavior (assuming you correct your filehandle problem) is clearly
documented in perlvar.

- Tom


------------------------------

Date: Mon, 19 Jun 2000 23:02:22 +0200
From: "TheEx0rcist" <TheEx0rcist@fanclub.org>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <8im1qc$1ne$1@news2.isdnet.net>

> Learn to use the documentation that comes with the Perl distribution.
>
> This behavior (assuming you correct your filehandle problem) is clearly
> documented in perlvar.


"clearly"?

hmm ... that documentation is many pages long. And as far as I can see, it
mostly documents all special variables ($|, $&, etc..)

It is nice you are pointing me to the perlvar documentation but it would be
even better you you could quote the part of this documentation that I need.

Thanks in advance.

--
TheEx0rcist.




------------------------------

Date: Mon, 19 Jun 2000 23:12:31 +0200
From: "TheEx0rcist" <TheEx0rcist@fanclub.org>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <8im2d2$2qdl$1@news4.isdnet.net>

> Besides the obvious bug in your program, it's worth looking at the perlvar
> manpage which - at least in recent incarnations - says that variables like
> $1 "are all read-only and dynamically scoped to the current BLOCK." This
> is a feature, not a bug, in case you're wondering. :-)
>
> Okay, before someone asks, here's why:
>
>     s/(.)(.)/ &some_sub($1) . &some_sub($2) /ge;
>
> Now imagine that &some_sub() does a pattern match of its own. Ouch!

Frankly I don't understand your explanations one bit.

I _really_ can't see why in the following code :

--
open (FILE,"$file") or die "$file : $!";
    while (<FILE>) {
        last if /(match)/;
    };
close (FILE);
print $1;
--

$1 should come empty (!)
What does the fact that it is read only has to do with it ?
$1 should always have the value of the last matched pattern! why not??

--
TheEx0rcist




------------------------------

Date: Mon, 19 Jun 2000 17:32:06 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <394E9156.A79F3F76@attglobal.net>

TheEx0rcist wrote:
> 
> > Learn to use the documentation that comes with the Perl distribution.
> >
> > This behavior (assuming you correct your filehandle problem) is clearly
> > documented in perlvar.
> 
> "clearly"?
> 
> hmm ... that documentation is many pages long. And as far as I can see, it
> mostly documents all special variables ($|, $&, etc..)
> 

$<digits>

Contains the subpattern from the corresponding set
of parentheses in the last pattern matched, not
counting patterns matched in nested blocks that
have been exited already.  (Mnemonic: like
\digits.)  These variables are all read-only.


------------------------------

Date: Mon, 19 Jun 2000 17:35:35 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <394E9227.DCA6A1E7@attglobal.net>

TheEx0rcist wrote:
> 
> >     s/(.)(.)/ &some_sub($1) . &some_sub($2) /ge;
          ^^^^^^
                \__ Eyes?  or... heh


> >
> I _really_ can't see why in the following code :

> open (FILE,"$file") or die "$file : $!";
>     while (<FILE>) {
>         last if /(match)/;
>     };
> close (FILE);
> print $1;
> --
> 
> $1 should come empty (!)
> What does the fact that it is read only has to do with it ?
> $1 should always have the value of the last matched pattern! why not??


$<digits>

Contains the subpattern from the corresponding set of parentheses in 
the last pattern matched, not counting patterns matched in nested 
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
blocks that have been exited already.  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

HTH


------------------------------

Date: Mon, 19 Jun 2000 22:35:33 +0100
From: "Stephen Collyer" <stephen@twocats.dont-spam.demon.co.uk>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <961450780.15924.0.nnrp-06.9e98901a@news.demon.co.uk>

> --
> open (FILE,"$file") or die "$file : $!";
>     while (<FILE>) {
>         last if /(match)/;
>     };
> close (FILE);
> print $1;
> --
>

> What does the fact that it is read only has to do with it ?

Nothing.

The problem is that you have set the value of $1 using
/(match)/ within a block, which is delineated by the {...}
of the while. Perl arranges things so that the $1, $2, ...
variables are implicitly local to closest enclosing block.

Implicitly local means that they behave as if you had
written:

local $1;

at the top of the block. This saves away the previous value
of $1 (which in this case was undef) and arranges to restore
the previous, undef value at the end of the block i.e. the end
of the while loop. Inside the block, $1 has the value you expect.
After the block, it's been set back to it's old undef value.

You can imagine that you had actually written code like this:

while (...) {
    my $copy = $1;   # save $1

    last if /(match)/;    # sets $1

    $1 = $copy;        # restore $1
}

because that's more or less what local does. And Perl
puts an implicit local $1 at the start of the block for you.
(Thanks to Jeffrey Friedl for that analogy).

> $1 should always have the value of the last matched pattern! why not??

I hope I've explained clearly enough.
Inside your loop you need to copy $1 into a variable
with more permanent lifetime, such as a global or some
my variable declared outside the block.

Steve Collyer.




------------------------------

Date: Mon, 19 Jun 2000 14:44:01 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <MPG.13b833ff3b7ead3798ab9e@nntp.hpl.hp.com>

In article <8im1qc$1ne$1@news2.isdnet.net> on Mon, 19 Jun 2000 23:02:22 
+0200, TheEx0rcist <TheEx0rcist@fanclub.org> says...
> > Learn to use the documentation that comes with the Perl distribution.
> >
> > This behavior (assuming you correct your filehandle problem) is clearly
> > documented in perlvar.
> 
> "clearly"?
> 
> hmm ... that documentation is many pages long. And as far as I can see, it
> mostly documents all special variables ($|, $&, etc..)
> 
> It is nice you are pointing me to the perlvar documentation but it would be
> even better you you could quote the part of this documentation that I need.

$<digits>

Contains the subpattern from the corresponding set of capturing 
parentheses from the last pattern match, not counting patterns matched 
in nested blocks that have been exited already. (Mnemonic: like 
\digits.) These variables are all read-only and dynamically scoped to 
the current BLOCK.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Mon, 19 Jun 2000 23:54:19 +0200
From: "TheEx0rcist" <TheEx0rcist@fanclub.org>
Subject: Re: [ Regexp ] Curious Behaviour of " last if /(match)/ "
Message-Id: <8im4ra$2iu5$1@news5.isdnet.net>

> I hope I've explained clearly enough.
> Inside your loop you need to copy $1 into a variable
> with more permanent lifetime, such as a global or some
> my variable declared outside the block.
>
> Steve Collyer.

Thanks Steve,

You have effectively explained what Perl does of its $<DIGIT> variables. But
not my actual question : "WHY?" :(

Why does Perl act likewise? Why doesn't $1 always have the value of the last
matched pattern, inside or outside a block? Normal variables ($variable) are
always the same inside or outside a block as long as you don't say
"local($variable)" so why should $<DIGIT> variables act otherwise? Why
should Perl assume "local($<DIGIT>)"? It nothing but obfuscating ...

Well I guess it is just a choice, which is not very wise in my opinion ...

--
TheEx0rcist





------------------------------

Date: 19 Jun 2000 17:02:08 -0400
From: David Meyers <dmeyers@panix.com>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <yobu2eppepb.fsf@panix3.panix.com>

jerome@activeindexing.com (Jerome O'Neil) writes:
> "Godzilla!" <godzilla@stomp.stomp.tokyo> elucidates:
> > Drew Simonis wrote:
> >  
> >> "Godzilla!" wrote:
> > (snipped trolling, harassment, personal insults)

> > As with others, I will ask you to not troll
> > and harass me. This sociopathic behavior of

> It's highly entertaining, watching people poke you.
> 
> You are our very own state machine!  What can we make you
> do next?

GoTrolla has already claimed several times to have
written perl robots.  Perhaps GoTrolla itself is the
evidence thereof.  As effective as it is, I'm quite
impressed.

--d



------------------------------

Date: Mon, 19 Jun 2000 21:23:10 +0200
From: Markus Hediger <hedim@hta-bi.bfh.xxx>
To: Bob Gregory <bgregory3@cs.com>
Subject: Re: Anyone use ActivePerl on Win95 or Win98
Message-Id: <394E731E.FBC642E@hta-bi.bfh.xxx>

hello...

Bob Gregory wrote:

> If I am running an Apache
> Server v1.3.9 what do I have to do to make it stop doing this?  Are
> you familiar with the Apache Server?

i'm sorry, no - why? configuration is too difficult! *g* if you just
want to test out cgi scripts on your local computer, but your computer
doesn't act as public server (i don't think that's the case when you're
running windoze 98), it actually would be sufficient to setup a small
server like xitami or omnihttpd. they are both easy to configure, don't
have too many features and can handle cgi scripts good enough to test
them out.

>     Can this problem be caused by the problem with notepad.exe putting
> CR/LFs in the file?

that's not the problem. if you try to execute such scripts, this results
just in a syntax error or something like this.

regards


------------------------------

Date: 19 Jun 2000 17:50:08 GMT
From: bmetcalf@baynetworks.com (Brandon Metcalf)
Subject: Re: arp cache
Message-Id: <8ilmgg$kf6$2@bcrkh13.ca.nortel.com>

s_shanmuganathan@hotmail.com writes:

 >    I want to write a utility to clear the arp cache in Perl. Is there any
 > SNMP command for this??? or Is there any MIB variables which can be set ???

And your Perl question is?

Brandon


------------------------------

Date: 19 Jun 2000 19:56:07 GMT
From: lvirden@cas.org
Subject: Re: Bot for this group to auto-answer queries?
Message-Id: <8iltsn$v2$2@srv38.cas.org>


According to Henry  <henry@penninkilampi.net>:
:In article <8idube$995$1@srv38.cas.org>, lvirden@cas.org wrote:
:
:>> They work on IRC, and they work with data mining.  Agents (call them 
:>> bots, spiders, or whatever you want) are the easiest way to get the 
:>> information you want.  People use them.
:> 
:> Can you point to some truly useful agents and bots?  I regret to
:> say that in my limited experience on internet (about 60 hrs a week
:> for 10-12 yrs) I don't recall encountering any of these - or if I
:> did encounter one, it was so cleverly written that I mistook it
:> for a human.
:

:34,000 hours on the Internet, and you've _never_ used a search engine???  
:I find that hard to believe.

Who said anything about a search engine - I said I don't recall encountering
a useful _agent_ ...  While in all likelihood the various search engines
are using some kind of agents in the background, I never see them...

And in fact, there are likely to be useful web services I've encountered that
are agents and I am just not connecting the service and the fact that they
are written as bots or agents.

-- 
<URL: https://secure.paypal.com/refer/pal=lvirden%40yahoo.com>
<URL: mailto:lvirden@cas.org> <URL: http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


------------------------------

Date: Mon, 19 Jun 2000 21:46:55 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Bot for this group to auto-answer queries?
Message-Id: <jxw35.4079$Zg4.18341@news1.rdc1.ct.home.com>

lvirden@cas.org wrote:

> According to Henry  <henry@penninkilampi.net>:
> :In article <8idube$995$1@srv38.cas.org>, lvirden@cas.org wrote:
> :
> :> Can you point to some truly useful agents and bots?  I regret to
> :> say that in my limited experience on internet (about 60 hrs a week
> :> for 10-12 yrs) I don't recall encountering any of these - or if I
> :> did encounter one, it was so cleverly written that I mistook it
> :> for a human.

> :34,000 hours on the Internet, and you've _never_ used a search engine???  
> :I find that hard to believe.

> Who said anything about a search engine - I said I don't recall encountering
> a useful _agent_ ...  While in all likelihood the various search engines
> are using some kind of agents in the background, I never see them...

> And in fact, there are likely to be useful web services I've encountered that
> are agents and I am just not connecting the service and the fact that they
> are written as bots or agents.

Well, I know that Northern Light has its Search Alert service that stores
a set of your queries and runs them with some regularity against new
versions of the web database and mails you when new stuff shows... Is that
the sort of thing that you're thinking of?

					Dan


------------------------------

Date: Tue, 20 Jun 2000 04:11:49 +0930
From: Henry <henry@penninkilampi.net>
Subject: Re: Crazy enough that it might just work...
Message-Id: <henry-731EBA.04114920062000@news.metropolis.net.au>

In article <slrn8kslst.i5i.dha@panix6.panix.com>, dha@panix.com (David 
H. Adler) wrote:

>> If an infant doesn't know how to talk, do parents give up trying to 
>> teach them?
> 
> Well, to follow this analogy, should they tell the infant "go away for
> a week or so and when you come back, maybe we'll help you"?  :-/

Under the microscope, everything breaks at some point of other.

The point of the analogy was that forcible education is _good_ for the 
uneducated, even if they bitch and moan.

Henry.


------------------------------

Date: Tue, 20 Jun 2000 04:18:18 +0930
From: Henry <henry@penninkilampi.net>
Subject: Re: Crazy enough that it might just work...
Message-Id: <henry-A154DB.04181820062000@news.metropolis.net.au>

In article <slrn8ksm8a.i5i.dha@panix6.panix.com>, dha@panix.com (David 
H. Adler) wrote:

> >Nope, the other way round.  I start hallucinating after 65-odd hours 
> >without sleep (which happens suprisingly often).  But in-between the 
> >weird stuff, there are extended periods of _extreme_ clarity - that's 
> >when the really good stuff gels (ethics, philosophy, and so-on).
> 
> Speaking as a philosopher, I feel obliged to point out that, given the
> admission of hallucinations due to lack of sleep, you are on somewhat
> shaky ground when assessing periods of this lack of sleep to be of
> "_extreme_ clarity".  :-)

Sometimes things make more sense when you look at them from different 
angles.  Sometimes it requires physical stimulation or deprivation to 
obtain those angles.  Sometimes it just takes someone else to describe 
the problem space in a different way.  I'm not fussy.  I'll take wisdom 
any way I can get it.

Henry.


------------------------------

Date: 19 Jun 2000 20:39:14 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Crazy enough that it might just work...
Message-Id: <8im0di$8d8$1@news.NERO.NET>

In article <henry-856462.00193719062000@news.metropolis.net.au>,
Henry  <henry@penninkilampi.net> wrote:
>Correct.  The basic model assumes no delay on subsequent posts.

Unfortunately for your basic model, there is always a delay for a
moderated group. 

>And for every repost they make, they will be sent another FAQ/pointer to 
>resources, and advised of the procedure.  

So when do these poor newbies stop getting pelted with your FAQs? Their
tenth post? Their fiftieth? You were saying just the first, now it is
for every post they make.

>In this way a newbie could post a question, then wander off and if they 
>solved their first question by other means, post another one and have 
>that replace the first in the queue.

And then wander off and not see the responses that the gurus you want to
protect will make. Then in two weeks they'll remember they asked
something, come back here, not find the answers, and post the question
again with a complaint that nobody answered the first time.

This protects the precious gurus precisely how?

>I believe that the only ones who will be so annoyed as to give up on 
>clpm, and never come back, are the people with no patience at all.  I 

You seem to have no patience. You are still here. 

>> Once again, I suggest you create a new group where you can test out
>> your suggested practise. If it's effective, people will migrate from
>> this group to yours. If it's not, this group hasn't been ruined.
>
>Unfortunately, that approach is, and will always be, doomed to failure.

If your approach will not work in any other group, it will not work
here. You admit that you would fail elsewhere, but continue to drone on
about how great this place would be if only we let you run it.

>example), the masses will virtually always choose the easiest, most open 
>path - right to the doorstep of clp.misc.

You will never do away with the only unmoderated USENET group for perl.
It ain't gonna happen. If your plan requires it, then your plan is
fatally flawed. Come up with a new plan. 

>I understand that there are concerns, but there is no reason why we 
>couldn't set the _initial_ delay to ZERO, and test the waters before 
>wading in.

Except the delay can NEVER be zero. If you understood how a moderated
group works, you would not make such ridiculous statements.

>Then, once that settled down, we could slowly bump up the delay period - 
>perhaps by an hour at a time, and _see_what_happens_.  If the 

In other words, you want to turn this group into your personal
experiment. Experiment elsewhere.

>At the very worst, what 
>would happen would have a bot available to automatically send FAQs to 
>new posters, but which lets their messages go straight though - just 
>like they do now.

No, at the very worst we wind up with a moderated group that is
moderated by someone who has no clue about how news works, who decides
that his experiment it taking too much of his time so he simply stops
running the bot. The group stops. 

That is just one "very worst". Another is we wind up with a moderator
who decides that he does not like articles that mention doughnuts, so
he rejects those. Then he takes a dislike to "hash".  Sounds like a
drug reference. "Killing zombie children" isn't acceptable for a family
oriented group.

>What could we possibly lose?

This group.



------------------------------

Date: 19 Jun 2000 20:42:13 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Crazy enough that it might just work...
Message-Id: <8im0j5$8e1$1@news.NERO.NET>

In article <henry-731EBA.04114920062000@news.metropolis.net.au>,
Henry  <henry@penninkilampi.net> wrote:
>The point of the analogy was that forcible education is _good_ for the 
>uneducated, even if they bitch and moan.

The users of this group are not your infants; you are not here to
forcibly educate anyone. 




------------------------------

Date: 19 Jun 2000 21:19:19 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: Crazy enough that it might just work...
Message-Id: <slrn8kt3in.8s8.dha@panix6.panix.com>

On Tue, 20 Jun 2000 04:18:18 +0930, Henry <henry@penninkilampi.net> wrote:
>In article <slrn8ksm8a.i5i.dha@panix6.panix.com>, dha@panix.com (David 
>H. Adler) wrote:
>
>> >Nope, the other way round.  I start hallucinating after 65-odd hours 
>> >without sleep (which happens suprisingly often).  But in-between the 
>> >weird stuff, there are extended periods of _extreme_ clarity - that's 
>> >when the really good stuff gels (ethics, philosophy, and so-on).
>> 
>> Speaking as a philosopher, I feel obliged to point out that, given the
>> admission of hallucinations due to lack of sleep, you are on somewhat
>> shaky ground when assessing periods of this lack of sleep to be of
>> "_extreme_ clarity".  :-)
>
>Sometimes things make more sense when you look at them from different 
>angles.  Sometimes it requires physical stimulation or deprivation to 
>obtain those angles.  Sometimes it just takes someone else to describe 
>the problem space in a different way.  I'm not fussy.  I'll take wisdom 
>any way I can get it.

Well, my point was that that method makes one's ability to tell if it
*is* in fact wisdom questionable...

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
It's amazing what giant mutant ants that are the result of Man's
dabbling with the power of atomic energy can accomplish when they set
themselves to the task.	   - Mark Rogaski


------------------------------

Date: 19 Jun 2000 21:30:08 GMT
From: bmetcalf@baynetworks.com (Brandon Metcalf)
Subject: Re: Crazy enough that it might just work...
Message-Id: <8im3d0$t55$1@bcrkh13.ca.nortel.com>

henry@penninkilampi.net writes:

 > In article <slrn8kofm3.ojo.abigail@alexandra.delanet.com>, 
 > abigail@delanet.com wrote:
 > 
 > > But, exactly, what posts is it going to stop? If someone doesn't lurk
 > > in the group first, and just asks a FAQ, that posting isn't going to
 > > be stopped.  It comes to the group after 8 days anyhow, after which
 > > it gets answered, while the posters no longer is interested in finding
 > > the answer.
 > 
 > I understand this, which is why I suggested (in the original post) that 
 > a new poster's message could be outright rejected (instead of being 
 > queued) and a FAQ/resource pointer immediately emailed back to them, 
 > informing them of the process and other (faster) ways to help themselves.

Geez, Henry.  Give it up.  Obviously nobody likes your idea.

 > > Once again, I suggest you create a new group where you can test out
 > > your suggested practise. If it's effective, people will migrate from
 > > this group to yours. If it's not, this group hasn't been ruined.

Exactly.  Now, next topic, Henry?

Brandon


------------------------------

Date: 19 Jun 2000 14:38:13 -0700
From: tcsh@holly.colostate.edu (Mike)
Subject: du perl trial - recursive neverending loop occurs
Message-Id: <slrn8kt15j.orr.tcsh@faure.cs.colostate.edu>

Hello,

For some reason, under some circumstances (like a space in the 
filename, as one case), this program goes on and on.  At any 
rate, I'm hoping someone may be able to see what I've been 
overlooking.

Thanks much for any ideas / overall suggestions,
-- 
Mike

# Code

#!/usr/local/bin/perl -w

use strict;
my $complete_tot=0;
&calc_it ('./');

sub calc_it {
  my ($name, $dir_search, @search_array, $pass_dir, $new_name);
  my $tot=0;
  $dir_search = $_[0];
  opendir(DIR, $dir_search);
  foreach $name(readdir(DIR)) {
    $new_name = $dir_search . $name;
#    print "$new_name *\n";
    if (-f $new_name) {
#      print "$new_name\n"; 
      $tot+=(stat($new_name))[7];
    }
    elsif (-d $new_name) { 
       $new_name .= "/";
#       print "$new_name is a directory\n";
       push(@search_array, $new_name); 
    }
   }
   print "$dir_search has $tot\n";
   $complete_tot+=$tot; 
   closedir(DIR);
   while (defined($pass_dir = pop(@search_array))) {
     if ($pass_dir !~ /\.{1,2}\/$/) {
#     print "Recursively calling with $pass_dir as arg\n";
     &calc_it($pass_dir);
     }
   }
}
print "The overall space total is : $complete_tot\n";


------------------------------

Date: Mon, 19 Jun 2000 14:05:43 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: du perl trial - recursive neverending loop occurs
Message-Id: <Pine.GSO.4.10.10006191358080.29843-100000@user2.teleport.com>

On 19 Jun 2000, Mike wrote:

> For some reason, under some circumstances (like a space in the 
> filename, as one case), this program goes on and on.  

That's one reason you should use a module like File::Find, rather than
coding a recursive directory search yourself.

Of course, if you step through your code in the debugger, you can easily
find where it takes a wrong turn.

>   opendir(DIR, $dir_search);

As with any other open-type request, you should check the return value to
discover whether it succeeded or failed.

>   foreach $name(readdir(DIR)) {
>     $new_name = $dir_search . $name;

That's not always portable (another reason to use File::Find) or correct,
if $dir_search doesn't end in a directory-name separator.

>     if (-f $new_name) {

>       $tot+=(stat($new_name))[7];

You're not allowing for symbolic links or files with multiple names, or
for files which can't be stat'ted. Also, the size of a file is easier to
get with -s, although there's nothing wrong with a slice.

>      if ($pass_dir !~ /\.{1,2}\/$/) {

Can't a directory be named, say, "fred."? Of course, this test, even if it
were correctly done, wouldn't be portable.

If you re-code with File::Find, your program will be simpler, more
portable, and more reliable. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Mon, 19 Jun 2000 21:35:07 GMT
From: "Ryan Tanner" <ryan.w.tanner@tek.com>
Subject: embedded ActivePerl 5.6 GUI code demo?
Message-Id: <fmw35.1817$9u5.165204@dfiatx1-snr1.gtei.net>

I looked at ActiveState's embbeded perl help pages. Their example does not
work (it is for version 5.0) in my application. Does anybody have some
example code, such as a dialog box that prompts for a file and then scans it
using perl? Please do not send console applications. Please do send your
link line, and include path.

Thanks!






------------------------------

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 3423
**************************************


home help back first fref pref prev next nref lref last post