[10482] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4073 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 26 15:27:13 1998

Date: Mon, 26 Oct 98 12:00:28 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 26 Oct 1998     Volume: 8 Number: 4073

Today's topics:
    Re: *Why* does clpm attract non-perl posts? (Nathan V. Patwardhan)
    Re: *Why* does clpm attract non-perl posts? birgitt@my-dejanews.com
        Communicating to ftp <maurerf@post.ch>
        Computer Bestsellers List - Oct. 26, 1998 suggest@10bestsellers.com
        CPAN.pm and socks <geddes@pavlov.col.hp.com>
        Date Comparision <support@counter.w-dt.com>
    Re: Date Comparision (Brand Hilton)
    Re: Date Comparision (Matt Knecht)
    Re: delete htm files (Joergen W. Lang)
    Re: Displaying the Time <lap@pop.net>
    Re: Displaying the Time (Craig Berry)
        encryption questions again (Orlando Frooninckx)
    Re: error code checking from ftp <murrayb@vansel.alcatel.com>
    Re: File download script? <perlguy@technologist.com>
        Forcing perl to garbage collect (Sullivan N. Beck)
    Re: Forcing perl to garbage collect (Michael J Gebis)
        gethostbyaddr <travis.cox@itron.com>
        Help: Multi-dimensional arrays & such <rweaver@raex.com>
        How to build perl using BCB 3.0 under WinNT <sailorbob24@hotmail.com>
    Re: LWP problem (was Re: Getting a web page content usi (Jason)
    Re: Monitoring a child process. (Sean McAfee)
    Re: Monitoring a child process. <tobez@plab.ku.dk>
        Netscape Enterprise 3.0 and Berkley DB_File joemoore@att.com
        newbie MAIL question <fred@somewhere.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 26 Oct 1998 18:10:30 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: *Why* does clpm attract non-perl posts?
Message-Id: <qW2Z1.340$dP4.70959@news.shore.net>

Lloyd Zusman (ljz@asfast.com) wrote:

: Which beginners and first-timers are you referring to?  Only very
: rarely do I see someone complaining about the auto-FAQ here.  I think
: that this must be a miniscule percentage of all the people who receive
: this auto-posting.

You haven't seen the complaints because Tom hasn't auto-FAQqed in
awhile, I think.  He might be able to tell you if he still does this,
but I don't think that he's done this for over a year.  

Last time, there was a huge battle over this -- the remnants of which
are probably located on DejaNews.

--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>


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

Date: Mon, 26 Oct 1998 19:25:29 GMT
From: birgitt@my-dejanews.com
Subject: Re: *Why* does clpm attract non-perl posts?
Message-Id: <712ib8$e8$1@nnrp1.dejanews.com>

In article <ltzpajj49z.fsf@asfast.com>,
  Lloyd Zusman <ljz@asfast.com> wrote:
> > [ ... ]
> >
> > Lloyd Zusman <ljz@asfast.com> writes:
> >
> I've seen a few of these also, now and then.  Most of the time, however,
> I see people posting off-topic questions, being corrected, and then
> disappearing, presumably to the appropriate newsgroups.

> > the spillover is less than I think, as a percentage of all such
> > posters.  It's certainly strikingly high as a percentage of clpm
> > posters.
>
> I agree that this is a strikingly high percentage, and then I ask
> myself why.  Here are some hypothetical reasons I came up with and
> considered:

[snipping reason 1 - 4]

>
> After a suitable amount of deliberation, I rejected reasons 1, 2, and
> 3, and I settled on number 4 as the most likely case, by far.

Is it possible the answer is much more simple ?

How about:  "because all these non-perl posts, even if they are annoying
to many, produce quite amusing reactions and apparently a lot of people
like to read through them.

Just imagine how boring clpm would be if all of you just would ignore
non-perl, FAQ and cgi-questions. :-)

B. Funk

B.Funk

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 26 Oct 1998 20:07:31 +0100
From: "Felix Maurer" <maurerf@post.ch>
Subject: Communicating to ftp
Message-Id: <712ibu$9vm@gd2inews.swissptt.ch>

I'm trying to communicate to ftp, in order to transfer files from one system
to an other. I know, there is some perl modules to do it, but I'm not
familiar with and I also like to learn by myself. So far I have the
following code, but I don't see how proceed with subsequent commands (like
login,ls and logout):

ftp_xfer();

sub ftp_xfer {
  my $ftp_host          = "some_node";
  my $ftp_con           = "ftp -in $ftp_host";
  my $ftp_login         = "user username pwd";
  my $ftp_dir           = "ls";
  my $ftp_logout        = "bye";

  use FileHandle;
  STDOUT->autoflush("1");

  exec $ftp_con;
  return;
}

Any hint to a newbie would be greatly appreciated




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

Date: Mon, 26 Oct 1998 19:34:53 GMT
From: suggest@10bestsellers.com
Subject: Computer Bestsellers List - Oct. 26, 1998
Message-Id: <3636cb9e.2194625@nntp.netcom.ca>

Top 10 Books: Computer Books Bestsellers List
October 26, 1998
----------------------------------------------------------------------
[*Note: Best Viewed in Courier Font*]


COMPUTER PROGRAMMING BOOKS
1)  The Perl Cookbook                     Tom Christiansen
2)  Programming Perl, 2nd ed.              Larry Wall
3)  Learning Perl, 2nd ed.                 Randal L. Schwartz
4)  Core Java 1.1: Fundamentals           Cay S. Horstmann
5)  Unix in a Nutshell                    Daniel Gilly
6)  Javascript Bible, 3rd ed.              Danny Goodman
7)  Javascript: The Definitive Guide      David Flanagan
8)  Java 1.1 Certification Study Guide    Simon Roberts
9)  Uml Distilled                         Martin Fowler
10) Java in a Nutshell                    David Flanagan


COMPUTER DATABASE BOOKS
1)  The Practical SQL Handbook            Judith S. Bowman
2)  Access 97 Developer's Handbook        Paul Litwin
3)  Oracle 8: The Complete Reference      George Koch
4)  Oracle PL/SQL Programming             Steven Feurstein
5)  Hitchhiker's Guide to Visual          William R. Vaughn
    Basic and SQL Server, 6th ed.
6)  Inside Microsoft SQL Server 6.5       Ron Soukup
7)  Cold Fusion Web Application           Ben Forta (Editor)
    Construction Kit
8)  Oracle Dba Handbook                   Kevin Loney
9)  Oracle Certified Professional Dba     Jason S. Couchman
    Certification Exam Guide
10) Access 97 Bible                       Cary N. Prague

This list is produced by Top 10 Books Inc. To see Best Selling 
Books in other popular categories visit their Home Page at:
http://www.10bestsellers.com/index2.html


-----------------------------------------------------------------------
Related Topics: Biography Books, Computer Books (Database & 
Programming), Health Books, Diet Books, Fitness Books, 
Sci-Fi Books, Fantasy Books, Stock & Investment Books, 
New York Times Bestsellers List, Publishers Weekly Bestselling 
Books



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

Date: 26 Oct 1998 10:31:04 -0700
From: Bill Geddes <geddes@pavlov.col.hp.com>
Subject: CPAN.pm and socks
Message-Id: <x97vhl7qlgn.fsf@fat-tire.col.hp.com>


I'm trying to get the CPAN module to configure using socks, not proxies.
It doesn't seem to be working.  
I point it at either a socksified ftp binary, or to a script that
exports SOCKS-SERVER and SOCKS_NS and calls the socksified ftp client.
No luck.
Something's likely obvious - but I've missed it.

-- 
Bill Geddes                            
  geddes@col.hp.com
  (719) 590-3556 


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

Date: Mon, 26 Oct 1998 13:01:03 -0600
From: Mike <support@counter.w-dt.com>
Subject: Date Comparision
Message-Id: <3634C6EE.DEBFC01D@counter.w-dt.com>

Does anyone know of a simple snipplet of code that would allow me to
compare two dates and see if one is latter than the other? I know their
are modules out their but i just want a simple perl example. Not a 85kb
module written in C or c++ or perl. Please post a simple way of
comparing the dates. Thanks for your time.



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

Date: 26 Oct 1998 19:34:53 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: Date Comparision
Message-Id: <712ist$gov9@mercury.adc.com>

In article <3634C6EE.DEBFC01D@counter.w-dt.com>,
Mike  <support@counter.w-dt.com> wrote:
>Does anyone know of a simple snipplet of code that would allow me to
>compare two dates and see if one is latter than the other? I know their
>are modules out their but i just want a simple perl example. Not a 85kb
>module written in C or c++ or perl. Please post a simple way of
>comparing the dates. Thanks for your time.

First, I have to say that I consider this rather an odd question.  You
don't want to use the wheels that are there, and you don't want to
reinvent the wheel... you want someone else to reinvent the wheel for
you.  And then you don't say what format the date is in, making it
rather difficult to do the reinventing :-)

Nevertheless, if all you want to know is whether one date is less than
another, and not how much they differ, the following should suffice
(assuming your year is y2k safe, and your month is numeric):

sprintf("%04d%02d%02d", $y1, $m1, $d1) cmp 
sprintf("%04d%02d%02d", $y2, $m2, $d2)

Enjoy!

-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: Mon, 26 Oct 1998 19:53:10 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Date Comparision
Message-Id: <Gq4Z1.4$1g4.1685585@news2.voicenet.com>

Mike <support@counter.w-dt.com> wrote:
>Does anyone know of a simple snipplet of code that would allow me to
>compare two dates and see if one is latter than the other? I know their
>are modules out their but i just want a simple perl example. Not a 85kb
>module written in C or c++ or perl. Please post a simple way of
>comparing the dates. Thanks for your time.

What makes you think it doesn't require a module of that size?  In fact,
your question illustrates exactly *why* a module of that size is
required.

You forgot to include what your dates looks like.  Are they Unix
timestamps?  Is so, then try:

print "$timestamp1 is later than $timestamp2\n" if $timestamp1 > $timestamp2;

Are they international timestamps?  If so, then try:

$date1 = '1998-10-26 14:33:27';
$date2 = '1998-10-26 09:54:20';
$date1 = tr/- ://d;
$date2 = tr/- ://d;

print "$date1 is ",
      ($date1 > $date2 ? 'younger' : 'older'),
      " than $date2\n";

Are they something else?  Are they different types from each other?  If
so, a module may be your best bet.

Note: I neither care about ties in the above code, nor munging what may be
important variables.

-- 
Matt Knecht - <hex@voicenet.com>


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

Date: Mon, 26 Oct 1998 20:23:33 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: delete htm files
Message-Id: <1dhiqer.dpb1865rl13qN@host006-210.seicom.net>

<rk27@my-dejanews.com> wrote:

> Sorry if this appears to be a stupid question.
> 
> How can I tell my cgi script to delete all *.htm files using unlink
> or some other command?
> 
> Thanks in advance,
> 
> rahul

unlink <*.htm> or some_other_command();

hth, HANT,

Joergen
-- 
  To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
   "Everything is possible - even sometimes the impossible"
             HOELDERLIN EXPRESS - "Touch the void"


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

Date: Mon, 26 Oct 1998 13:49:49 -0500
From: Larry Palkendo <lap@pop.net>
Subject: Re: Displaying the Time
Message-Id: <3634C44C.1ABDE3E7@pop.net>

You can try the following which should do what you want it to




Gareth Ennis wrote: $currtime = time();
$time = localtime($currtime);

print "$time\n";

hope this helps.



> Easy......
>
> I want to simply display the time and date in a logical format -
> (something like - 12:34 Tuesday 23 Oct 1998)
>
> I tried using -
> print localtime (time);
>
> but it prints out a whole range of numbers like :
>
> 1357112199832931
>
> Please help.....
> --
> Gareth Ennis
> ABACUS - Strathclyde University
> email: gary.ennis@strath.ac.uk
> http://iris.abacus.strath.ac.uk/new/






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

Date: 26 Oct 1998 19:36:08 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Displaying the Time
Message-Id: <712iv8$eak$1@marina.cinenet.net>

Larry Palkendo (lap@pop.net) wrote:
: You can try the following which should do what you want it to
: 
: $currtime = time();
: $time = localtime($currtime);
: 
: print "$time\n";

Sure seems a long-winded way to express

  print scalar localtime;

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Mon, 26 Oct 1998 17:05:48 GMT
From: Frook@mail.dma.be (Orlando Frooninckx)
Subject: encryption questions again
Message-Id: <3634aa96.358401163@193.74.210.130>

Hi Everyone,

for some crypting of personal files I was trying to put some crypting
source I found into a procedure. this procedure goes wrong after a
while though. Does anyone have any notice on how to correct this? Is
this a safe method or not?

please gimme some feedback on this...

kind regards,
Orlando

#----------------------------------------------------------------
# start procedure
#----------------------------------------------------------------
sub EnDeCrypt { 
    # Localize variables and assign subroutine input.
    local( $CryptString, $Password ) = @_;
	local( $Crypted ) = '';	
	local($crypt_array_item) = '';
	local($for_couter_255) = 0;
	local($arrayloop) = 0;
	local(@crypt_array) = ();
	local(@s) = ();
	local(@k) = ();
	local($unpacked)='';
	local($i) = 0;
	local($x) = 0;
	local($y) = 0;

	(@k=unpack('C*',pack('H*',$Password)))||die"script
miss-used\n";
	
	for($for_couter_255=0; $for_couter_255<256; $for_couter_255++)
{
		$s[$for_couter_255] = $for_couter_255;
	}

	for($for_couter_255=0; $for_couter_255<256; $for_couter_255++)
{
		$y=($k[$i]+$s[$for_couter_255]+$y)%256;
		$x=$for_couter_255;
		($s[$x], $s[$y])=($s[$y], $s[$x]);
		$i++;
		$i%=$#k+1;
		}
		
	$/=$x=$y=0;

	for ($arrayloop=0; $arrayloop<length($CryptString);
$arrayloop++) {
	   push(@crypt_array,substr($CryptString,$arrayloop,1));
	}

	foreach $crypt_array_item (@crypt_array) {
	   $unpacked = unpack('C*',$crypt_array_item);
	   $x++;
	   $x%=256;
	   $y=($s[$x]+$y)%256;
	   ($s[$x], $s[$y])=($s[$y], $s[$x]);
	   $Crypted .= pack('C',$unpacked^=$s[($s[$x]+$s[$y])%256]);
	}

	@crypted_array = ();
	return $Crypted;
}



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

Date: 26 Oct 1998 08:47:46 -0800
From: Brad Murray <murrayb@vansel.alcatel.com>
Subject: Re: error code checking from ftp
Message-Id: <uogqzclsd.fsf@vansel.alcatel.com>

hemant_bendre@smb.com writes:

> How do I check the error code from ftp  in perl:
> 
> Sample code:
> 
>    open(FTP, "|ftp -i -n");
>    print FTP "open hostname\n";
>    print FTP "user username password\n";
> 
> How will I check the rror code from "open hostname" command or any other ftp
> command?
> 
> Any help is appreciated.

Consider Net::FTP instead.  I'm sure it will do what you want and has the
advantage of letting you check for errors as well.

-- 
Brad Murray       "...and they that weave networks shall be confounded"
Software Analyst                                         Isaiah, 19:9
Alcatel Canada


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

Date: Mon, 26 Oct 1998 17:09:19 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: File download script?
Message-Id: <3634ACBF.40A575B3@technologist.com>

Without http links?  Try FTP.

HTH,
Brent
-- 
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: 26 Oct 1998 14:05:03 -0500
From: sbeck@cise.ufl.edu (Sullivan N. Beck)
Subject: Forcing perl to garbage collect
Message-Id: <xz367d7kuu8.fsf@cave.cise.ufl.edu>


For security reasons (or paranoia if you prefer), we've been trying to
figure out a way to have a value completely removed from memory.  To
illustrate, I create a file "z.in" containing "abc123" (so this string
doesn't appear anywhere in the perl script itself).  Then I run the
script:

     #!/usr/local/bin/perl
     
     $i=`cat z.in`;
     undef $i;
     
     `sleep 3000`;

While it's sleeping, I send it a signal to dump core, and then run "strings"
on the core file, and "abc123" is present.

I'm assuming that this is becuase the memory containing "abc123" has been
flagged for garbage collection, but g.c. hasn't actually occurred yet.  If
this is the wrong assumption, could someone please enlighten me?  If it's
correct, is there a way to force perl to garbage collect?

Thanks in advance.

------------------------------------------------------------------------------
Sullivan Beck                      http://www.cise.ufl.edu/~sbeck/
 sbeck@cise.ufl.edu  | This space reserved for some saying demonstrating great
 PH : (352) 392-1057 | wisdom, wit, or insight.  I'll fill it in just as soon
 Fax: (352) 392-1220 | as I have any of the above.
------------------------------------------------------------------------------


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

Date: 26 Oct 1998 19:22:01 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Forcing perl to garbage collect
Message-Id: <712i4p$k14@mozo.cc.purdue.edu>

sbeck@cise.ufl.edu (Sullivan N. Beck) writes:

}For security reasons (or paranoia if you prefer), we've been trying to
}figure out a way to have a value completely removed from memory.  To
}illustrate, I create a file "z.in" containing "abc123" (so this string
}doesn't appear anywhere in the perl script itself).  Then I run the
}script:

}     #!/usr/local/bin/perl
}     
}     $i=`cat z.in`;
}     undef $i;
}     
}     `sleep 3000`;

}While it's sleeping, I send it a signal to dump core, and then run "strings"
}on the core file, and "abc123" is present.

Out of curiosity, what happens if you add:

	$i =~ s/./\0/g;

Right after the cat and right before the undef?  I think that you will
have cleared the memory, and "abc123" will not show up in the core.
(I have not tried it, though.)

I also think that 1) you can't force perl to garbage collect without
exiting and 2) even if you could, there's no guarantee that garbage
collection will clear memory, so garbage collection isn't what you
want anyway.  I'm sure someone more intimate with the guts of perl
will speak up and correct me if I'm wrong.


-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Mon, 26 Oct 1998 10:33:23 -0800
From: travis cox <travis.cox@itron.com>
Subject: gethostbyaddr
Message-Id: <3634C073.26E6@itron.com>

I have a DEC unix 4.0b system and have it set up to do host lookups in
/etc/hosts first and DNS second. When I do a gethostbyaddr it only
uses DNS and not /etc/hosts. Is there a workaround for this problem or
should I just grep the /etc/hosts file?


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

Date: Mon, 26 Oct 1998 14:41:50 -0500
From: Ralph <rweaver@raex.com>
Subject: Help: Multi-dimensional arrays & such
Message-Id: <Pine.LNX.4.02.9810261431320.17137-100000@mortis.raex.com>

Ok... is there a way to do this

--------------]cut[-----------
#!/usr/bin/perl
# Test program for MDAs
@arr1 = (1,2,3);
@arr2 = (4,5,6);
@arr3 = \(@arr1,@arr2);
@arr4 = @arr3[0];

print "\@arr1 = @arr1\n";
print "\@arr2 = @arr2\n";
print "\@arr3 = @arr3\n";
print "\@arr4 = @arr4\n";
-------------]cut[------------

The output looks like this...
@arr1 = 1 2 3
@arr2 = 4 5 6
@arr3 = ARRAY(0x80bf098) ARRAY(0x80bf0f8)
@arr4 = ARRAY(0x80bf098)

The output i'm aiming for is like this...
@arr1 = 1 2 3
@arr2 = 4 5 6
@arr3 = ARRAY(0x80bf098) ARRAY(0x80bf0f8)
@arr4 = 1 2 3

Sooooooooo....... basically i think i want a way to get from the ARRAY
string back to the actual value contained within the array rather than
having the pointer to the memory location listed... i've look around but
can't seem to find the info i need (or overlooked it.)  Also if someone
has a good multidimensional array/hash/vect/etc/etc faq and would point me
that direction i would really appreciate it.  Thanks in advance for any
help! 

Regards,
Ralph



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

Date: Mon, 26 Oct 1998 21:15:05 +0200
From: Robert Shriver Barnes <sailorbob24@hotmail.com>
Subject: How to build perl using BCB 3.0 under WinNT
Message-Id: <3634CA39.A8B4DB24@hotmail.com>

The question is fairly basic.  I would like to embed a bare bones perl
compiler in a Borland C++ Builder 3.0 app under WinNT.  I downloaded
the perl5.005_2 source code package and after reading the readme.win32
and other docs I'm a little confused.  Anyone have experiance in this
area?


Thanks,
    SailorBob





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

Date: 26 Oct 1998 17:14:54 GMT
From: robobob@blech.mindwell.com (Jason)
Subject: Re: LWP problem (was Re: Getting a web page content using perl)
Message-Id: <slrn739bge.4b6.robobob@blech.mindwell.com>

On Mon, 26 Oct 1998 12:41:58 GMT, mrauschkolb@yahoo.com wrote:
>
>
>OK, I downloaded libwww, and while trying to install, it says that I need
>4 more modules: HTML::Parser MIME::Base64 NET::FTP and ,MD5 (optional)
>
>I've found all but the FTP module -- where is it, or what is it called?
>
FTP is part of libnet, CPAN/modules/by-module/Net/libnet-1.0605.tar.gz

-- 
                Jason Kohles -- Internet Consultant
        http://www.mindwell.com/~jason/  jason@mindwell.com

    Even if you aren't in doubt, consider the mental welfare of the person who
    has to maintain the code after you, and who will probably put parens in
    the wrong place.  --Larry Wall in the perl man page 


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

Date: Mon, 26 Oct 1998 17:13:44 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Monitoring a child process.
Message-Id: <c52Z1.3622$fS.11630780@news.itd.umich.edu>

In article <3634A232.1036A78D@americasm01.nt.com>,
Bowler, Michael (EXCHANGE:CRK:5T11) <mkbowler@americasm01.nt.com> wrote:
>Is there a quick way to query the state of a child process? ie. Can I tell if
>a child is still alive after I have forked it and done some processing?

>    if ($pid = fork) {
>        #Some parent processing.
>    } elsif (defined($pid)) {
>        #Child processing here.
>        CORE::exit;
>    } else {
>        &ErrorDialog("Cannot fork new process!");
>    }
>
>    #Some more parent processing.
>    if ($pid is alive) {    #How do I do this?
>        print "Child is still alive!";
>    }

if (kill 0, $pid) {
	# child is alive
}

See the perlipc manpage.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: 26 Oct 1998 17:51:07 +0100
From: Anton Berezin <tobez@plab.ku.dk>
Subject: Re: Monitoring a child process.
Message-Id: <8667d7s1vo.fsf@lion.plab.ku.dk>

"Bowler, Michael (EXCHANGE:CRK:5T11)" <mkbowler@americasm01.nt.com> writes:

> Is there a quick way to query the state of a child process? ie. Can I tell if
> a child is still alive after I have forked it and done some processing?

man perlipc  is your friend.  Then search for `kill 0'.

-- 
Anton Berezin <tobez@plab.ku.dk>
The Protein Laboratory, University of Copenhagen


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

Date: Mon, 26 Oct 1998 19:10:42 GMT
From: joemoore@att.com
Subject: Netscape Enterprise 3.0 and Berkley DB_File
Message-Id: <712hfh$viv$1@nnrp1.dejanews.com>

For maintaining Access Control Lists (ACL) Netscape allows 2 formats, one is
plain text, the other is a DBM file.  Under a previous version, the dbm file
used ndbm, version 3.0 requires Berkley DB format.

Bundled with this is a program to do the conversions but it breaks on very
long files.  I tried to make my own Perl converter, but the default format I
get back is a single file.  The format Netscape uses creates a directory
using the db name and it contains 2 files: Users.id and Users.db

I can't read those the way I am trying.  Do I need to add some options to the
tie command?

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 26 Oct 1998 13:03:35 +0000
From: fred <fred@somewhere.com>
Subject: newbie MAIL question
Message-Id: <3634731E.5F2D@somewhere.com>

I'm having trouble with what is only my second Perl script. I am just
trying to send an email. It DOES work -- the email is sent, but in the
email message that goes out the Subject line appears blank and instead
the Subject text appears in the body of the message (followed by what I
wanted to be the body of the message).

Any ideas? I know I'm missing the obvious.

#!/usr/bin/perl5

$mailprog = '/usr/sbin/sendmail';
$recipient = 'fred@somewhere.com';
$email = 'fred@somewhere.com';
print "Content-type: text/plain\n\n";

open (MAIL, "|$mailprog $recipient") || die "unable to send request\n";
print MAIL "Reply-to: $email\n\n";
print MAIL "Subject:  My Test\n\n";

print MAIL "This is the message to print";

close (MAIL);
print "it worked";


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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