[31846] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3109 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 1 21:09:46 2010

Date: Wed, 1 Sep 2010 18:09:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 1 Sep 2010     Volume: 11 Number: 3109

Today's topics:
    Re: Help writing 'simple' loop <kst-u@mib.org>
    Re: Help writing 'simple' loop (Randal L. Schwartz)
    Re: Help writing 'simple' loop <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: Is /proc there (from Perl on BSD) <nospam-abuse@ilyaz.org>
    Re: Is /proc there (from Perl on BSD) <ben@morrow.me.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 01 Sep 2010 15:42:02 -0700
From: Keith Thompson <kst-u@mib.org>
Subject: Re: Help writing 'simple' loop
Message-Id: <lnpqwxw0g5.fsf@nuthaus.mib.org>

Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> writes:
> On 2010-08-27, Ben Morrow <ben@morrow.me.uk> wrote:
>>
>> There's this novel concept known as 'regular expressions'... 
>
> I challenge you to write a simple regex that matches all of ''Joey's''
> From headers in this thread.  ;-)

/.*/

8-)}

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"


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

Date: Wed, 01 Sep 2010 16:10:11 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Help writing 'simple' loop
Message-Id: <86fwxt2h7w.fsf@red.stonehenge.com>

>>>>> "Keith" == Keith Thompson <kst-u@mib.org> writes:

Keith> Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> writes:
>> On 2010-08-27, Ben Morrow <ben@morrow.me.uk> wrote:
>>> 
>>> There's this novel concept known as 'regular expressions'... 
>> 
>> I challenge you to write a simple regex that matches all of ''Joey's''
>> From headers in this thread.  ;-)

Keith> /.*/

Lots of collateral damage though.

print "Just another Perl hacker,"; # the original

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Wed, 1 Sep 2010 16:31:05 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Help writing 'simple' loop
Message-Id: <pa43l7x063.ln2@goaway.wombat.san-francisco.ca.us>

On 2010-09-01, Keith Thompson <kst-u@mib.org> wrote:
> Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> writes:
>> On 2010-08-27, Ben Morrow <ben@morrow.me.uk> wrote:
>>>
>>> There's this novel concept known as 'regular expressions'... 
>>
>> I challenge you to write a simple regex that matches all of ''Joey's''
>> From headers in this thread.  ;-)
>
> /.*/
>
> 8-)}

I can see it now:

Newsgroups: comp.lang.perl.misc
Subject: HELP!!!~

I can no longer see anybody's posts.  Why can't I see anything?  Since I
can't see your post please email me with any advice!

--keith

-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



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

Date: Wed, 1 Sep 2010 19:29:28 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Is /proc there (from Perl on BSD)
Message-Id: <slrni7taco.1el.nospam-abuse@powdermilk.math.berkeley.edu>

On 2010-09-01, Ben Morrow <ben@morrow.me.uk> wrote:
>> How to check that /proc is working on BSD?  And check it from Perl?
>
> Well, the obvious answer is to check the output of `/sbin/mount` for
>
>     procfs on /proc

I'd hate to do it "in real life" due to it being in unknown-in-advance
directory.  "In testing", it is not there on FreeBSD machine...

> A decent compromise might be to compare st_dev on a stat of "/" and
> "/proc".

Are you sure it is going to work when / is unionfs etc?

>> On Linux and Solaris,
>>   -d "/proc/$$"
>> is TRUE.  Apparently (by indirect guesses from output on CPANtesters),
>> this does not work on 3 BSD test machines (Open-, Free- and Net-).
>
> Here (FreeBSD 8.1) that is *always* true. The directory /proc exists
> even if procfs isn't mounted on it. (I'm pretty certain this is true of
> at least Linux, as well.) You can, however, check 
>
>     -d "/proc/$$".

I hope one notices that two discussed tests are identical.  ;-)

But anyway, it looks like -d "/proc/$$" works fine on FreeBSD machine
without procfs mounted...  (In the sense that it detects availability
of procfs on /proc.)  Basically, it means that the current state of

  ilyaz.org/software/tmp/auto-debug-module-0.02.zip

is as good as one can expect from 0.02 release...  I will make a more
formal announcement ASAP.  (Currently tested with
Audio-FindChunks-1.04.tar.gz where I found a bug long ago, but use it
as a testbed for auto-debug-module.)

>> Neither does
>> 
>>  perl -wle 'open PR, qq(/proc/$$/cmdline) or die $!'
>> 
>> on the only BSD machine I can login into (FreeBSD 7.3).
>
> That's...weird. (Unless that machine doesn't have procfs mounted, of
> course.)

It is not mounted indeed.

>> How should I interpret this?  Is /proc "very optional", and disabled
>> by default?
>
> Yes. It's also vaguely deprecated, though as you say a number of things
> still depend on it, so I'm not really sure what that means. AIUI the
> supported alternative for new programs is the sysctl interface, but the
> whole situation is still rather unsatisfactory.

I tried to find the proof in the pudding:

  gdb     `which perl`
  gdb> b main
  gdb> r
  gdb> info proc mapping

and it does not work on machine which has procfs disabled.  I could
not find pmap either (anyway, I did not manage to find how to access
the PID of the child process from gdb command line, so I would not be
able to call `!pmap $childpid' or somesuch anyway...).

What a mess!

Thanks,
Ilya


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

Date: Thu, 2 Sep 2010 01:00:12 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Is /proc there (from Perl on BSD)
Message-Id: <c163l7-gdh1.ln1@osiris.mauzo.dyndns.org>


Quoth Ilya Zakharevich <nospam-abuse@ilyaz.org>:
> On 2010-09-01, Ben Morrow <ben@morrow.me.uk> wrote:
> >> On Linux and Solaris,
> >>   -d "/proc/$$"
> >> is TRUE.  Apparently (by indirect guesses from output on CPANtesters),
> >> this does not work on 3 BSD test machines (Open-, Free- and Net-).
> >
> > Here (FreeBSD 8.1) that is *always* true. The directory /proc exists
> > even if procfs isn't mounted on it. (I'm pretty certain this is true of
> > at least Linux, as well.) You can, however, check 
> >
> >     -d "/proc/$$".
> 
> I hope one notices that two discussed tests are identical.  ;-)

Uh, yes. Apparently I can't read :).

Ben



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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 V11 Issue 3109
***************************************


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