[12139] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5739 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 21 02:16:42 1999

Date: Thu, 20 May 99 23:00:16 -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           Thu, 20 May 1999     Volume: 8 Number: 5739

Today's topics:
    Re: -w does not work on W32? <aperrin@mcmahon.qal.berkeley.edu>
    Re: -w does not work on W32? <pkotala@logis.cz>
    Re: Can't use string as a hash ref... <elliotsl@mindspring.com>
    Re: conditional regexp matching. Please advise. <ebohlman@netcom.com>
    Re: Copy/paste on Win95 with Tk <ebohlman@netcom.com>
        Dynamic Thumnail Generation?? <bob@bob.com>
    Re: How about two arrays? [Was: Blasting array into has (Ronald J Kimball)
    Re: How to move a directory? <ltl@rgsun5.viasystems.com>
        Memory reference error in NT with perl module <gwe@X.com>
        Memory reference error while loading Perl module on NT <svadakke@aloe.qualcomm.com>
    Re: Parsing email headers (Ronald J Kimball)
    Re: Perl "constructors" armchair@my-dejanews.com
        Perl Programmer needed for special program (Mind Logic)
    Re: Perl Unicode/Multibyte Support (Ilya Zakharevich)
    Re: search and fetch from newsgroup <ebohlman@netcom.com>
    Re: Seek on STDIN? (Ronald J Kimball)
    Re: stripping text with regex (Tad McClellan)
    Re: Tie Fighter (Fuzzy Warm Moogles)
    Re: undef of namespaces (Ronald J Kimball)
    Re: wait(), zombies, and solaris: why won't my children zenin@bawdycaste.org
    Re: Y2K.  localtime(time) <ebohlman@netcom.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 20 May 1999 20:48:20 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: -w does not work on W32?
Message-Id: <3744D784.8023F379@mcmahon.qal.berkeley.edu>

The answer to your question could be found by adding $! to the die
message:

open(X, ">x.txt") or die "Can not open x.txt: $!\n";

which will explain to you why it can't open it.

ap

Pavel Kotala wrote:

> What do I wrong? In the script on Windows NT:
>
> while (! -W "x.txt")
> {
> }
> open(X, ">x.txt") or die "Can not open x.txt";
>
> I receive "Can not open x.txt".
>
> Thank you
>
> Pavel Kotala



--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting -  (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
     http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------




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

Date: Fri, 21 May 1999 06:57:41 +0200
From: "Pavel Kotala" <pkotala@logis.cz>
Subject: Re: -w does not work on W32?
Message-Id: <927262829.99478@gate.logis.cz>

> The answer to your question could be found by adding $! to the die
> message:
>
> open(X, ">x.txt") or die "Can not open x.txt: $!\n";
>
> which will explain to you why it can't open it.
>
> ap
>
> Pavel Kotala wrote:
>
> > What do I wrong? In the script on Windows NT:
> >
> > while (! -W "x.txt")
> > {
> > }
> > open(X, ">x.txt") or die "Can not open x.txt";
> >
> > I receive "Can not open x.txt".
> >
> > Thank you
> >
> > Pavel Kotala
>
>
>
> --
> -------------------------------------------------------------
> Andrew J. Perrin - NT/Unix/Access Consulting -  (650)938-4740
> aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
>      http://www.geocities.com/SiliconValley/Grid/7544/
> -------------------------------------------------------------
>
>

Sorry, I did not write, that I expect, the file is locked - I simulate it by
opening it by MS Word.


On

 open(X, ">x.txt") or die "Can not open x.txt: $!\n";

I receive

 "Can not open x.txt: Permission denied".


This is the method (certainly not the best) I want be sure, that other
program, which communicates with me by files have message completely writen.
After I have message read, I remove file.

Thank You very much

Pavel Kotala





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

Date: Thu, 20 May 1999 23:34:05 -0400
From: Steven Elliott <elliotsl@mindspring.com>
Subject: Re: Can't use string as a hash ref...
Message-Id: <3744D42C.A1577D08@mindspring.com>

Daniel Parish wrote:

> The following bit works (it's part of a much larger script that also
> works), but it dies with a fatal error with 'use strict':
>
>  'Can't use string ("nk2.2-1.17-RA") as a HASH ref while
> "strict refs" in use at test.pl line 16, <FITFILE> chunk 1.'
>
> I've looked at 'Tie::RefHash', but I can't claim to understand its
> usage in this context.

Guessing by it's name "Tie::RefHash" would be useful if you were trying
to tie a hash reference to a database using tied variables which isn't
quite what you are trying to do.

> Would someone please be so kind as to point
> me at the 'proper' construct with which to replace
> '$$i{$ro} = $fitvalue;'?

I'm guessing that what you would like to do is create an hash table for
each filename prefix that appears in the "@filelist" array with a name
that matches the filename prefix.  You then want to populate this hash
table with with the first two whitespace delimited (awk style) fields in
each file.

Unfortunately, since variable names can't be variables in perl, perl is
interpreting the extra "$" to mean that you want to dereference
something.  Although you could accomplish what you want to do with
eval() with something like this:

    eval "\$main::$i{$ro} = $fitvalue;";

you probably want to avoid that since later when you want to iterate
through all of the hash tables you will be forced to use a similarly
ugly and inefficient eval() syntax.  Instead, you should consider using
references to create a hashtable that relates the filename prefixes to
references to hashtables that contain the fields.  Something like:

    # previous lines removed
    my %file_contents = ();  # = () needed to suppress a '-w' warning
about referencing an uninitialized variable?
   $main::all_files{$i} = \%file_contents;
        while ( $thisline = <FITFILE> ) {
                chomp $thisline;
                ($ro, $fitvalue) = split(" ", $thisline);
                $file_contents{$ro} = $fitvalue;
       }
    # following lines removed

I may have made some typos in the above since I don't have perl handy on
the OS on which I'm composing this message, but it should be fairly
close.

> Thanks in advance.
>
> Daniel
> <danielp@best.com>
>
> #!/usr/sbin/perl -w
>
> use strict;
>
> my ($i, $ro, $fitvalue, $thisline);
> my @filelist = qw( nk2.2-1.17-RA nk2.2-1.04-RA nk2.2-1.17-A
>                    nk2.2-1.17-RA nk2.2-1.18-A nk2.2-1.18-RA
>                    nk2.2-1.26-A nk2.2-1.26-RA );
>
> foreach $i (@filelist) {
>         open (FITFILE, "$i-BWL.rofit")
>           || die "Could not open file $i-BWL.rofit; $!";
>         while ( $thisline = <FITFILE> ) {
>                 chomp $thisline;
>                 ($ro, $fitvalue) = split(" ", $thisline);
>                 $$i{$ro} = $fitvalue;
>         }
>         close FITFILE;
> }



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

Date: Fri, 21 May 1999 04:51:33 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: conditional regexp matching. Please advise.
Message-Id: <ebohlmanFC2G5y.AAF@netcom.com>

Ravi Kumar <ravik@cyrix.com> wrote:

: given a string of substance ...
: region1-region2-region3

: find a regexp rule like so
: capture region2 iff (region1 OR region2) AND !(region1 AND region2)

Which, of course, can be rephrased "capture region2 iff (region1 XOR 
region3)", which immediately translates into Perl:

/region2/ if /region1/ ^ /region3/;

(I'm assuming you made a typo in your description and that "region2" 
should be "region3" in the logical expressions.)


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

Date: Fri, 21 May 1999 05:27:13 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Copy/paste on Win95 with Tk
Message-Id: <ebohlmanFC2HtD.C47@netcom.com>

Patrick Renaud <patrick.renaud@transport.alstom.com> wrote:
: I'm working with Perl (ActiveState) and Tk on Win95 and don't find in
: the documentation a way to use the window's clipboard to copy and paste
: datas beetween 2 applications.

There's a Win32::Clipboard module floating around somewhere (I think 
there's a version on ActiveState's site).



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

Date: Thu, 20 May 1999 21:55:35 -0700
From: "bob" <bob@bob.com>
Subject: Dynamic Thumnail Generation??
Message-Id: <7i2p53$d2m$1@carroll.library.ucla.edu>

Does anyone know if there is a perl script or equivalent way to create
'thumbnails on the fly'...any help is very much appreciated.

thanks,
robert




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

Date: Fri, 21 May 1999 00:37:30 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: How about two arrays? [Was: Blasting array into hash ???]
Message-Id: <1ds4nz6.2g3jml1w0u3b4N@p80.block2.tc2.state.ma.tiac.com>

Matthew O. Persico <mpersico@erols.com> wrote:

> I have had, on occasion needed to put two arrays into a hash - one array
> was keys, the other values. I've used this:
> 
> for (@keyArray) {
>   $hash{$_} = pop @valueArray;
> }

Why are you taking from the back of @valueArray?

> If I couldn't destroy valueArray:
> 
> for($i=0;$i<=$#keyArray;$i++) { 
>   $hash{$keyArray[$i]} = $valueArray[$i];
> }
> 
> Seems to me there should be a "slicey" way to to this, but I've been
> unable to grok it from perldoc perlfaq4. Anyone willing to point out the
> solution I should have figured out by now?

I agree, you should have figured this out by now...  ;)

@hash{@keyArray} = @valueArray;

List on the left, list on the right.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 20 May 1999 23:27:16 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: How to move a directory?
Message-Id: <7i25ok$s6v$1@rguxd.viasystems.com>

Hans-Georg Rist <hans-georg@rist.net> wrote:
:>"Jalil Feghhi" <jalil@corp.home.net> wrote:

:>>I also noticed that rename does not work accross file system boundaries or
:>>network, which is what I want
:>>
:>>Is there any perl function or module that can help me with that? Or, should
:>>I write my own function and move all the files one by one?

:>use File::Copy;

Doesn't preserve file ownership or permissions.  That wasn't part
of the requirements of the original post, but..

>From a shell I do something like this

cd FROM_DIR
tar cf - . | (cd TO_DIR; tar xpf -)

You can do that with a system command in a perl program, but checking
for success or failure is kind of hard.  

-- 
// Lee.Lindley   | There was a time when I thought that "being right"
// @bigfoot.com  | was everything.  Then I realized that getting along
//    | was more important.  Still, being right is more fun!
//    | And if I'm wrong, somebody will get some joy out of telling me!


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

Date: Thu, 20 May 1999 21:38:18 -0700
From: G We <gwe@X.com>
Subject: Memory reference error in NT with perl module
Message-Id: <3744E33A.D42CDFA7@X.com>

Hi,

We have an application that uses SWIG. I use the SWIG generated
wrapper and build a DLL on Windows NT. The DLL builds fine and
in the past I have been able to invoke methods in the DLL using
perl scripts through the perl module
gen------------------------------------------------------------------
C:\prj\DCF_GWES.13May1999>perl -I. test.pl
DynaLoader.pm loaded (. c:\Perl\lib\site c:\Perl\lib c:\perl\lib
c:\perl\lib\sit
e c:\perl\lib\site ., c:\bc5\lib)
DynaLoader::bootstrap for DCF_GWES (auto/DCF_GWES/DCF_GWES.dll)
dl_findfile(-L. -Lc:\Perl\lib\site -Lc:\Perl\lib -Lc:\perl\lib
-Lc:\perl\lib\sit
e -Lc:\perl\lib\site -L. DCF_GWES)
 checking in . for DCF_GWES.dll
dl_findfile found: ./DCF_GWES.dll
dl_load_file(./DCF_GWES.dll):
 libref=10000000
dl_find_symbol(handle=10000000, symbol=boot_DCF_GWES)
  symbolref = 100016c7
dl_install_xsub(name=DCF_GWES::bootstrap, symref=100016c7)

--------------------------------------------------------------------
I get these error messages in pop-up windows.

The instruction at 0x00265603" referenced memory at "0xff2a1474". The
erated by SWIG. I do not
modify any of the wrapper code generated by SWIG.

Now when I re-built the DLL on NT today and tried invoking methods
using perl scripts, I got the following error message
(I have set PERL_DL_DEBUG variable on NT to 100 to enable verbose mode)

Note:
test.pl is my test program that has just one line use DCF_GWES;
DCF_GWES.dll is the DLL I built on NT.
memory could not be "read".
The exception unknown software exception(0xc0000027) occured in the
application at location 0x77f3af90.


I'm unable to fathom the source of this error. I'd greatly appreciate
any pointers.

Thanks,
Prasad
email: jgd@eudoramail.com



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

Date: Thu, 20 May 1999 21:49:37 -0700
From: sameer <svadakke@aloe.qualcomm.com>
Subject: Memory reference error while loading Perl module on NT
Message-Id: <Pine.SO4.4.05.9905202147100.7484-100000@aloe.qualcomm.com>


Hi,

We have an application that uses SWIG. I use the SWIG generated
wrapper and build a DLL on Windows NT. The DLL builds fine and
in the past I have been able to invoke methods in the DLL using
perl scripts through the perl module generated by SWIG. I do not
modify any of the wrapper code generated by SWIG.

Now when I re-built the DLL on NT today and tried invoking methods
using perl scripts, I got the following error message
(I have set PERL_DL_DEBUG variable on NT to 100 to enable verbose mode)

Note:
test.pl is my test program that has just one line use DCF_GWES;
DCF_GWES.dll is the DLL I built on NT.

------------------------------------------------------------------
C:\prj\DCF_GWES.13May1999>perl -I. test.pl
DynaLoader.pm loaded (. c:\Perl\lib\site c:\Perl\lib c:\perl\lib
c:\perl\lib\sit
e c:\perl\lib\site ., c:\bc5\lib)
DynaLoader::bootstrap for DCF_GWES (auto/DCF_GWES/DCF_GWES.dll)
dl_findfile(-L. -Lc:\Perl\lib\site -Lc:\Perl\lib -Lc:\perl\lib
-Lc:\perl\lib\sit
e -Lc:\perl\lib\site -L. DCF_GWES)
 checking in . for DCF_GWES.dll
dl_findfile found: ./DCF_GWES.dll
dl_load_file(./DCF_GWES.dll):
 libref=10000000
dl_find_symbol(handle=10000000, symbol=boot_DCF_GWES)
  symbolref = 100016c7
dl_install_xsub(name=DCF_GWES::bootstrap, symref=100016c7)

--------------------------------------------------------------------
I get these error messages in pop-up windows.

The instruction at 0x00265603" referenced memory at "0xff2a1474". The
memory could not be "read".
The exception unknown software exception(0xc0000027) occured in the
application at location 0x77f3af90.


I'm unable to fathom the source of this error. I'd greatly appreciate
any pointers.

Thanks
Sameer 



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

Date: Fri, 21 May 1999 00:37:31 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Parsing email headers
Message-Id: <1ds4onv.vc0ebqui0d5N@p80.block2.tc2.state.ma.tiac.com>

David Raufeisen <raufeisen@home.com> wrote:

> I have "John Doe <jdoe@somewhere.com>" in variable $HEADER{'from'}
> 
> how would i do the following
> 
> put
> 
> John into $fname
> Doe into $lname
> jdoe@somewhere.com into $email
> jdoe into $user

($first, $last, $email, $user) =
  $HEADER{'from'} =~ /^(\S+)\s+(\S+)\s+<(([^\@]+)\@[^>]+)/;

Note that this is not a general purpose regex.  It only works for lines
formatted just like the one above.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 21 May 1999 05:00:12 GMT
From: armchair@my-dejanews.com
Subject: Re: Perl "constructors"
Message-Id: <7i2p8s$5d3$1@nnrp1.deja.com>

In article <7i1kjh$b7k$1@nnrp1.deja.com>,
  John Porter <jdporter@min.net> wrote:
> In article <7ht7kc$6hi$1@nnrp1.deja.com>,
>   armchair@my-dejanews.com wrote:

> But more relevantly, Meyers' book contains a lot of great info
> which is applicable in other languages besides C++.
>
> (Um, you know I'm referring to "Effective C++", by Scott Meyers,
right?
> I don't care much for Bertrand Meyer, except as a quotable authority.)
>
Yep, and I even looked at the case # you referred to.


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Fri, 21 May 1999 04:34:25 GMT
From: mike@mindlogic2.com (Mind Logic)
Subject: Perl Programmer needed for special program
Message-Id: <3744e2e1@newsbox.grin.net>

Hello,

I've inquired to this newsgroup twice before in the last week with offers of 
work. I currently have a third project which I'm looking to obtain price 
quotes for.

I run a site which sells special VCRs called Multisystem VCRs. Unfortunately 
it's a complex field and we are in need of some kind of questionnaire which 
will help users find the VCR we are in need of.

There should be two levels to this. One where we input the data about VCRs and 
would be able to add/remove/change the characteristics of VCRs. Because our 
VCRs are constantly in and out of stock, discontinued and in rare cases change 
specifications we'll need to be able modify, add and remove various models.

The second level would be for the public where they simply answer a series of 
questions. Here's a basic layout-

Tapes standards -> Tuner types -> Mono or Stereo -> Features -> Results

E-mail me and I will send you a more detailed explanation of our needs. I'm 
looking for bids on this project. Lowest bids wins, of course, keeping in mind 
a realistic completion time.

All inquires welcomed. Currently there's no deadline for the project but I 
would still like to complete this as soon as possible. Thanks for your time.

- Mike 





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

Date: 21 May 1999 05:24:03 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl Unicode/Multibyte Support
Message-Id: <7i2qlj$6hk$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.11ae3594aa131aaf989ad4@nntp.hpl.hp.com>:
> > There is no conversion of any kind.  Perl strings are just sequences
> > of small integers.  Without `use utf8' small means 0..255.  With `use
> > utf8' small means 0..2**36-1.  This is the only difference (forgetting
> > about speed and bugs).
> 
> 0..2**32-1 I hope. 

Why would this make you happier?

> Unless you are using some sort of ancient Honeywell 
> machine, or whatever.  :-)

UTF-8 encoding is not depending on the hardware.  It translates a sequence
of numbers 0..2**36-1 to a sequence of numbers 0..255 (octets) so that:

   a) The law is local: any number is translated to the same sequence
      of octets no matter what is the position of this number in the
      initial sequence;

   b) The inverse translation is local: given a chunk of the
      resulting sequence of octets, one can determine the "boundaries"
      of encoding of the original numbers (thus cut this
      chunk to a smaller chunk which is a UTF-8 encoding of the
      subsequence of the initial sequence of numbers);

   c) numbers 0..127 are translated to themselves;

   d) Lexicographical ordering of sequences of numbers agrees with the
      lexicographical ordering of sequences of octets.

Ilya


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

Date: Fri, 21 May 1999 05:07:12 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: search and fetch from newsgroup
Message-Id: <ebohlmanFC2Gw0.B79@netcom.com>

Ying Hu <yhu@mail.nih.gov> wrote:
: Which win32 module is with the function that can search newsgroups
: and/or download some pieces of news from newsgroups by the subject?
: For example, the perl script can search the Subject of comp.soft-sys.sas
: with ANOVA key word and download the news (with ANOVA)
: from the newsgroup.

None of the Win32::* modules deal with this, because accessing news 
servers isn't Win32-specific, regardless of how much Bill Gates might 
wish it was.  The Perl modules for dealing with newsgroups that I know of 
are Net::NNTP (part of the libnet bundle, available from CPAN and 
ActiveState) and News::NNTPClient (available from CPAN at least).



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

Date: Fri, 21 May 1999 00:37:35 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Seek on STDIN?
Message-Id: <1ds4pb3.4uej8m1ynhmp6N@p80.block2.tc2.state.ma.tiac.com>

Al Sharka <asharka@my-dejanews.com> wrote:

> Ronald J Kimball wrote:
> > Al Sharka <asharka@my-dejanews.com> wrote:
> > 
> > > open(README, "zcat $ARGV[0] |") || die "Couldn't fork: $!\n";

> [...]

> Thank you.  Now, is there a way to accomplish skipping through
> $ARGV[1] records without performing a read statement (literally
> could be a million times), or is that how I have to do it?

Unzip to a file first.  Then you can seek all you want.  :)

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 20 May 1999 19:04:15 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: stripping text with regex
Message-Id: <fd42i7.0je.ln@magna.metronet.com>

ainsoph@propaganda-arts.org wrote:
: Is it possible to use regex to stip the text off of a string, say a
: first name, and turn it into an initial?

: example: chris = c


   No, you need an operator to do that.

   A regex is not enough.

   Luckily, Perl is equipped with such an operator.


   Perl's operators are discussed in the aptly named
   'perlop.pod' man page.

   I think the substitute operator ( s/// ) would be helpful.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 21 May 1999 04:14:48 GMT
From: tgy@chocobo.org (Fuzzy Warm Moogles)
Subject: Re: Tie Fighter
Message-Id: <3744d9ea.80354125@news.oz.net>

On Thu, 20 May 1999 12:10:04 GMT, pudge@pobox.com (Chris Nandor) wrote:

>By the way, if you don't believe me (still!) that package variables are
>always global, and you've grepped perlsub for all instances of 'global'
>and 'package' and STILL don't believe me, then see mjd's article "Coping
>with Scoping".
>
>    http://www.plover.com/~mjd/perl/FAQs/Namespaces.html
>
>Don't know why you'd believe him and not me, though ;-), so maybe it won't help.

Well, I believed him. :)  And it helped.  Thanks!

-- 
Fuzzy | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=


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

Date: Fri, 21 May 1999 00:37:48 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: undef of namespaces
Message-Id: <1ds4pjn.172ik20ufthkqN@p80.block2.tc2.state.ma.tiac.com>

Marc Dietrich <g059@mailserv.uni-giessen.de> wrote:

> It works correct in debugger mode (as you show it).

*&^%$#@!

I hate things that only work in the debugger.

Sorry.

So why do you want to undef a whole namespace?

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 21 May 1999 04:19:36 GMT
From: zenin@bawdycaste.org
Subject: Re: wait(), zombies, and solaris: why won't my children die?
Message-Id: <927260905.106826@localhost>

Charlie Stross <charlie@antipope.org> wrote:
: On a Linux system, when you fork a child it's reasonable to tidy
: up afterwards by saying something like
:     $SIG{CHLD} = sub { print STDERR "$$ reaped child ", wait , "\n"; };  
: But on Solaris, well, we obviously ain't in Kansas any more. Doing
: this seems to result in the parent process dying.

	It's probably dumping core.  Take out the IO in the handler and
	you'll probably fair better.

: Taking out the SIGCHILD handler altogether, meanwhile, spawns zillions of
: zombies (yes, it's a forking server I'm working on, and the children
: insist on being wait()'ed for.)

	Well, if you really, truly don't care what actually happened to your
	children, you can completely ingore them and never wait() if you
	set the right sigaction:

	use POSIX qw(:signal_h);

	sigaction (
	    SIGCHLD,
	    POSIX::SigAction->new (
	        'main::handler',
	        POSIX::SigSet->new (SIGCHLD),
	        SA_NOCLDWAIT,
	    ),
	    new POSIX::SigAction,
	) or die "sigaction(SA_NOCLDWAIT): $!, stopped";

	__END__

	Disclaimer: I make no claims that this will work on all platforms,
	or infact any.  You also may well screw up any fork()ing code in
	other modules with this design.

-- 
-Zenin (zenin@archive.rhps.org)         Caffeine...for the mind.
                                        Pizza......for the body.
                                        Sushi......for the soul.
                                             -- User Friendly


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

Date: Fri, 21 May 1999 04:41:44 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Y2K.  localtime(time)
Message-Id: <ebohlmanFC2FpK.9K7@netcom.com>

J. Moreno <planb@newsreaders.com> wrote:
: Because it fits their preconceptions.  One of the things that people are
: great at is making patterns, even where one doesn't exist.  So when they
: are doing "Y2K testing" and a year value returns 100, bing-bang-boom
: "YEAR 2K BUG" alarm bells start going off and the brain shuts down.

I think you're right about this; it's probably a subcase of the 
phenomenon called "psychological set."

I'd strongly advise anyone who's serious about programming to read Gerald 
Weinberg's classic _The Psychology of Computer Programming_, which was 
just re-released in a 25th anniversary edition last year.  The first 2/3 
are devoted to programming as a group activity, complete with the usual 
management-blunder horror stories, and the last 1/3 is about programming 
as an individual activity.

Of special interest to the Perl community, and all other open-source 
communities, is his concept of "egoless programming."  Nearly 30 years 
ago, Weinberg more-or-less argued that peer review could be the magic 
bullet for increasing software quality.  It looks like he's been proven 
right.  He was one of the earliest proponents of writing programs so that 
humans could read and learn from them.




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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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