[26594] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8722 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 30 06:05:31 2005

Date: Wed, 30 Nov 2005 03:05:04 -0800 (PST)
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, 30 Nov 2005     Volume: 10 Number: 8722

Today's topics:
        ANNOUNCE: Last chance to register for OSDC 2005 <simon@unisolve.com.au>
        ANNOUNCE: Win32::GUI v1.03 <rmay@popeslane.clara.co.uk>
    Re: Help:  String search in Windows 2000 doesn't find t <armingaud@noos.fr>
        Killing all child processes upon parent exit <snort_sam@yahoo.com>
    Re: Killing all child processes upon parent exit (Anno Siegel)
    Re: Killing all child processes upon parent exit <snort_sam@yahoo.com>
    Re: Killing all child processes upon parent exit (Anno Siegel)
    Re: Killing all child processes upon parent exit <snort_sam@yahoo.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 30 Nov 2005 17:50:11 +1100
From: Simon Taylor <simon@unisolve.com.au>
Subject: ANNOUNCE: Last chance to register for OSDC 2005
Message-Id: <dmji4f$1bm7$1@otis.netspace.net.au>

OSDC 2005 is almost upon us.

If you haven't already registered, then you have until 4pm this Friday 
to do so.

See  http://www.osdc.com.au/registration/

Don't miss out on this unique and exciting Australian Open Source event 
- which includes an "Introduction to Pugs: Perl 6 in Haskell" keynote 
from Autrijus Tang
  	
Regards,

Simon Taylor


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

Date: Tue, 29 Nov 2005 21:45:05 GMT
From: Robert May <rmay@popeslane.clara.co.uk>
Subject: ANNOUNCE: Win32::GUI v1.03
Message-Id: <Iqqt89.1Hvq@zorch.sf-bay.org>

I am please to announce that v1.03 of Win32::GUI is available for
download from SourceForge.

Win32::GUI is a Perl extension allowing creation of native Win32 GUI
applications.

MORE INFORMATION

   Project Homepage:
   http://perl-win32-gui.sourceforge.net/

   Project summary and download:
   http://sourceforge.net/projects/perl-win32-gui/

   Release notes:

http://sourceforge.net/project/shownotes.php?group_id=16572&release_id=373056

RELEASE SUMMARY

   This is a summary of changes between Win32-GUI V1.02 and V1.03
   See the CHANGELOG file in the distribution for the
   full detail.

   V1.03 is primarily a bug-fix release.

New Features in V1.03
=====================
  + New methods:
     - Win32::GUI::DC    StretchBlt
     - Win32::GUI        GetParent UserData

  + New events:
     - none

  + New Documentation:
     - Win32::GUI::RichEdit SetCharFormat GetCharFormat SetEventMask
     - Win32::GUI::GetAsyncKeyState
     - Win32::GUI::Timer and all Timer methods
     - various other minor documentation corrections and enhancements

  + Other New things
     - Added Version information to GUI.dll: right-click to see Version
     - many tests added
     - added listvew_drag_drop.pl to the samples demonstrating the use
       of drag/drop with a ListView
     - ImageList support is now complete under MinGW and Cygwin if
       headers are recent enough (w32api V3.2 or higher)
     - Updated all the Tutorial documentation and added tutorial
       examples to the demos directory.

Fixes in V1.03
==============
  + Reported Bugs
     - Fix to 4 item call to TrackPopupMenu.  Tracker 1241830
     - GUI.pm Fix to logic in Win32::GUI::Class::new for perl 5.8.6
       and above. Tracker:1236053
     - GUI.pm fixed Win32::GUI::Brush to return undef on failure
     - GUI_messageloops.cpp: Tracker 1246429 fixed WM_CTLCOLORSTATIC
       for handling readonly Edit controls
     - Tooltip.xs, GUI.xs fixed Tooltip styles (Tracker: 1273134)
     - GUI_MessageLoops.cpp change all mouse event handlers to use
       GET_X_LPARAM and GET_Y_LPARAM rather than HIWORD and
       LOWORD (Tracker: 1262098)
     - GUI.xs fixed UnHook() to resolve perl 5.6/5.8 differences in
       av_delete, causing a warning in perl 5.8 (Tracker: 1164766)
     - GUI.xs: Changed DoModal's use of GetParent to
       GetWindow(hwnd, GW_OWNER).  (Tracker: 1165626)
     - GUI_messageloops.cpp: Tracker:1236283 Change to WM_ERASEBACKGROUND
       to allow -background to work with windows

  + Other Bugs
     - GUI_messageloops.cpp: Fixed WM_CTLCOLOR* to use window class
       background brush if there is one
     - Richedit.xs fix SetCharCofmat/GetCharFormat option
     - GUI.pm Timer fixes (Reini Urban)
     - GUI.pm fixed Win32::GUI::DC::new() with no params to return a
       correct object
     - GUI_Constants.cpp: correct TMP_NONOTIFY to TPM_NONOTIFY
(aschwarz1309)
     - Listbox.xs: fixed buffer overrun in GetText causing crash (Jez White)
     - Combobox.xs: fixed buffer overrun in GetLBText causing crash
(Jez White)
     - GUI.xs: fixed return value of GetAsyncKeyState
     - Re-worked Win32::GUI::Timer package implementation.  Now destruction
       works correctly.

Contributors to this release:
=============================
Dan Dascalescu
Reini Urban
Jeremy White
aschwarz1309
Robert May

My thanks to all the others who have provided invaluable comments and
testing.

Rob.  22nd November 2005




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

Date: Wed, 30 Nov 2005 08:47:41 +0100
From: fda <armingaud@noos.fr>
Subject: Re: Help:  String search in Windows 2000 doesn't find text in Windows XP: MS Word document SOLVED: binmode
Message-Id: <438d591c$0$445$79c14f64@nan-newsreader-05.noos.net>

Mark Clements wrote:

> 
> Even a stopped clock tells the right time twice a day.

And even tells us when it does so : exactly at the time where it is stopped.


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

Date: Wed, 30 Nov 2005 20:58:07 +1100
From: bsder <snort_sam@yahoo.com>
Subject: Killing all child processes upon parent exit
Message-Id: <438d77ba@news.rivernet.com.au>

Hi,

Could anyone please tell me how to kill all child processes when parent 
exit?

Here is the server code:

#!/usr/bin/perl

use strict;
use Socket;
use Data::Dumper;

# forward declaration
sub logmsg { print "$0 $$: @_ at ", scalar localtime, "\n" }

$SIG{INT} = $SIG{TERM} =$SIG{HUP} = \&signal_handler;
$SIG{CHLD} = 'IGNORE';
$SIG{CLD} = 'IGNORE';

my %kids = {};
my $proto = getprotobyname('tcp');
socket(SOCK,PF_INET,SOCK_STREAM,$proto) || die "socket : $!";
my $port = 7888;
my $address = pack_sockaddr_in($port, INADDR_ANY);

bind(SOCK, $address) || die "bind : $!";

while (1) {
       listen(SOCK, SOMAXCONN) || die "listen: $!";
       my $hostName = inet_ntoa(INADDR_ANY);
       logmsg "server started on port $port, $hostName";

       sub REAPER {
           my $waitedpid = wait;
           $SIG{CHLD} = \&REAPER;
           logmsg "reaped $waitedpid" . ($? ? " with exit $?" : '');
       }
       $SIG{CHLD} = \&REAPER;

       print STDOUT "Server host: $hostName\n";
       print STDOUT "Server port: $port\n";
       (my $addr = accept(NEWSOCK,SOCK)) or ($! eq 'Interrupted system 
all' and redo) or die $!;
       select(NEWSOCK); $| = 1; select(STDOUT);

       my $kidpid;
       if (!defined($kidpid = fork())) {
          die "cannot fork: $!";
       }
       elsif ($kidpid == 0) { # child
          my ($cPort, $cHost) = unpack_sockaddr_in($addr);
          my $cHostName = inet_ntoa($cHost);
          print STDOUT "Client host: $cHostName\n";
          print STDOUT "Client port: $cPort\n";
          print NEWSOCK "Welcome to Code Generator.\r\n";

          while (my $m=<NEWSOCK>) {
             $m =~ s/\n|\r//g;
             last if ($m eq ".");
             print NEWSOCK "Server received $m\r\n";
          }
          close(NEWSOCK) || die "close in child: $!";
          delete %kids->{$kidpid};
          exit;
       }
}


sub signal_handler
{
     local $SIG{HUP} = 'IGNORE';
     kill HUP => -$$;
     print STDOUT "going to die\n";
     exit;
}

Client code:
#!/usr/bin/perl


    $domain = 2; # Internet domain
    $type = 1; # Sequenced, reliable, two-way connection, byte streams
    $proto = 6; # Transmission Control Protocol (TCP)
    socket(SOCK,$domain,$type,$proto);
    $host = pack('C4', 127,0,0,1); # localhost = 127.0.0.1
    $port = 1024;
    $address = pack('S n a4 x8', $domain, $port, $host);
    bind(SOCK, $address);
    print STDOUT "Client host: ",join('.',unpack('C4', $host)),"\n";
    print STDOUT "Client port: $port\n";
    $sHost = pack('C4', 127,0,0,1); # localhost = 127.0.0.1
    $sPort = 7888;
    $sAddress = pack('S n a4 x8', $domain, $sPort, $sHost);
    connect(SOCK, $sAddress);
    print STDOUT "Server host: ",join('.',unpack('C4', $sHost)),"\n";
    print STDOUT "Server port: $sPort\n";
    select(SOCK); $| = 1; select(STDOUT);
    while ($m=<SOCK>) {
       print STDOUT $m;
       $m = <STDIN>;
       print SOCK $m;
    }
    close(SOCK);
    exit;

Thanks
Sam


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

Date: 30 Nov 2005 10:01:57 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Killing all child processes upon parent exit
Message-Id: <dmjtal$n9b$1@mamenchi.zrz.TU-Berlin.DE>

bsder  <snort_sam@yahoo.com> wrote in comp.lang.perl.misc:
> Hi,
> 
> Could anyone please tell me how to kill all child processes when parent 
> exit?

What's the problem?  You have the PID, Perl has the kill() function.

Anno
-- 
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article.  Click on 
"show options" at the top of the article, then click on the 
"Reply" at the bottom of the article headers.


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

Date: Wed, 30 Nov 2005 21:24:40 +1100
From: bsder <snort_sam@yahoo.com>
Subject: Re: Killing all child processes upon parent exit
Message-Id: <438d7dea$1@news.rivernet.com.au>

Anno Siegel wrote:
> bsder  <snort_sam@yahoo.com> wrote in comp.lang.perl.misc:
> 
>>Hi,
>>
>>Could anyone please tell me how to kill all child processes when parent 
>>exit?
> 
> 
> What's the problem?  You have the PID, Perl has the kill() function.
> 
> Anno

Yes I have added the kill() function in the signal_handler(), is this a 
proper way to add kill() function in signal handler?

Thanks
Sam


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

Date: 30 Nov 2005 10:48:17 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Killing all child processes upon parent exit
Message-Id: <dmk01h$o4k$2@mamenchi.zrz.TU-Berlin.DE>

bsder  <snort_sam@yahoo.com> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> > bsder  <snort_sam@yahoo.com> wrote in comp.lang.perl.misc:
> > 
> >>Hi,
> >>
> >>Could anyone please tell me how to kill all child processes when parent 
> >>exit?
> > 
> > 
> > What's the problem?  You have the PID, Perl has the kill() function.
> > 
> > Anno
> 
> Yes I have added the kill() function in the signal_handler(), is this a 
> proper way to add kill() function in signal handler?

In which signal handler?  That doesn't make sense.  A signal handler is
activated when the process receives a signal.  You want to *send* a
signal when the process exits, so call kill() when it exits.

If you want to automate the kill-on-exit, you could call the kill function
in an END block.  Look up END in perlmod to see the possibilities and
limitations.

Anno
-- 
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article.  Click on 
"show options" at the top of the article, then click on the 
"Reply" at the bottom of the article headers.


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

Date: Wed, 30 Nov 2005 22:01:47 +1100
From: bsder <snort_sam@yahoo.com>
Subject: Re: Killing all child processes upon parent exit
Message-Id: <438d869e@news.rivernet.com.au>

Anno Siegel wrote:
> bsder  <snort_sam@yahoo.com> wrote in comp.lang.perl.misc:
> 
>>Anno Siegel wrote:
>>
>>>bsder  <snort_sam@yahoo.com> wrote in comp.lang.perl.misc:
>>>
>>>
>>>>Hi,
>>>>
>>>>Could anyone please tell me how to kill all child processes when parent 
>>>>exit?
>>>
>>>
>>>What's the problem?  You have the PID, Perl has the kill() function.
>>>
>>>Anno
>>
>>Yes I have added the kill() function in the signal_handler(), is this a 
>>proper way to add kill() function in signal handler?
> 
> 
> In which signal handler?  That doesn't make sense.  A signal handler is
> activated when the process receives a signal.  You want to *send* a
> signal when the process exits, so call kill() when it exits.
> 
have you look thru my server code? the signal handler is at the end of 
the server code. I want to kill all its child processes when the server 
code received an interrupt signal.

sam
> If you want to automate the kill-on-exit, you could call the kill function
> in an END block.  Look up END in perlmod to see the possibilities and
> limitations.
> 
> Anno


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

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:

#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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 8722
***************************************


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