[30583] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1826 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 29 11:09:49 2008

Date: Fri, 29 Aug 2008 08:09:14 -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           Fri, 29 Aug 2008     Volume: 11 Number: 1826

Today's topics:
    Re: [Q] How to seach an unmapped network drive <RedGrittyBrick@spamweary.invalid>
    Re: hang when I run perl -MCPAN -e 'install Net::SSH::P jason.antonacci@gmail.com
        Help: Variables problem <openlinuxsource@gmail.com>
    Re: Help: Variables problem <peter@makholm.net>
    Re: Help: Variables problem <openlinuxsource@gmail.com>
    Re: Internal limit on variable length? <dn.perl@gmail.com>
        new CPAN modules on Fri Aug 29 2008 (Randal Schwartz)
        newbie also <deniserz@verizon.net>
    Re: Perl Newbie <simon.andrews@bbsrc.ac.uk>
        Posting Guidelines for comp.lang.perl.misc ($Revision:  tadmc@seesig.invalid
    Re: subprocesses lifecycle <ced@blv-sam-01.ca.boeing.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 29 Aug 2008 11:07:23 +0100
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: [Q] How to seach an unmapped network drive
Message-Id: <48b7ca5d$0$2930$fa0fcedb@news.zen.co.uk>


Back9 wrote:
> Hi,
> 
> Does anyone know of how to seach an unmapped network drive in Windows
> XP to map it?
> 

Yes.

Well, I know how to find out how.

I'd work out how to do it from Window's Command-Prompt window. I usually 
use Google for this part. Then (since this is a Perl newsgroup) I'd 
maybe write a Perl script that encapsulates the necessary commands, 
processes the output and takes the desired actions.

I might search CPAN for a relevant module too.

-- 
RGB


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

Date: Fri, 29 Aug 2008 07:36:51 -0700 (PDT)
From: jason.antonacci@gmail.com
Subject: Re: hang when I run perl -MCPAN -e 'install Net::SSH::Perl'
Message-Id: <18b16b70-979f-480c-b4ea-f52d8d35f72a@z66g2000hsc.googlegroups.com>

From cpan I got to the same point then <ctrl+c> exited.  I then re-ran
with "force install Net::SSH::Perl".

I'm using Ubuntu JeOS 8.04.1 (32-bit).

On Aug 24, 1:21=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Stephane Charette <stephanechare...@gmail.com>:
>
>
>
> > I'm trying to get Net::SSH::Perl installed. =A0I did install
> > Math::BigInt::GMP, Math::GMP, Math::Pari, and various other modules
> > without problem.
>
> > But when I run "perl -MCPAN -e 'install Net::SSH::Perl'" the whole
> > thing hangs at this point:
>
> > t/03-packet......ok 1/10
>
> > At this point it consumes none of the CPU, but never completes. =A0CTRL
> > +C breaks out and aborts the installation. =A0I see plenty of posts
> > about this when searching with Google, but no answer. =A0Can anyone
> > help?
>
> > I'm using Ubuntu 8.04-32bit i686 arch, perl 5.8.8 that ships with
> > Ubuntu.
>
> I get the same result here. After a little investigation, it appears to
> be a bug in the test suite, but I don't really understand it. What seems
> to be happening is
>
> =A0 =A0 The test replaces the internal socket handle with a tied FH, so i=
t
> =A0 =A0 can test what gets sent and received.
>
> =A0 =A0 This tied filehandle claims to have a fileno of 255 (but doesn't,=
 of
> =A0 =A0 course).
>
> =A0 =A0 This filehandle is passed to an IO::Select instance, which tries =
to
> =A0 =A0 select on fd 255.
>
> =A0 =A0 This fd isn't open, so the select hangs.
>
> I wonder if the behaviour of select(2) when passed a bitmap not
> containing any open filehandles has changed? In any case, I would say
> it's clearly a bug: report it to the author, if it hasn't been already.
>
> Ben
>
> --
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0We do not stop playing because we grow old=
;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 we grow old because we stop playing.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 b...@morrow.me.uk



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

Date: Fri, 29 Aug 2008 22:44:18 +0800
From: Amy Lee <openlinuxsource@gmail.com>
Subject: Help: Variables problem
Message-Id: <pan.2008.08.29.14.44.12.262957@gmail.com>

Hello,

I'm writing a script to parse the contents of /proc/loadavg file. And the
file is like this:

0.22 0.11 0.03 1/92 2653

And I hope my script output is like this:

1 minute loadavg: 0.22
5 minutes loadavg: 0.11
10 minutes loadavg: 0.03
Running processes: 1 processes
Total processes: 92 processes

And there's my codes:

open LOADAVG, "<", "/proc/loadavg"
  or die RED "Can't open /proc/loadavg. $!";
while (<LOADAVG>)
{
  <LOADAVG> =~ /(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+(\d+)\/(\d+)\s+\d+/;
  print "1 minute loadavg: $1.$2\n";
  print "5 minutes loadavg: $3.$4\n";
  print "10 minutes loadavg: $5.$6\n";
  print "Running processes: $7 processes\n";
  print "Total processes: $8 processes\n";
}
close LOADAVG;

But when I excute this codes such errors shows:

Use of uninitialized value in concatenation (.) or string at ./soms.pl line 16, <LOADAVG> line 1.
Use of uninitialized value in concatenation (.) or string at ./soms.pl line 16, <LOADAVG> line 1.
1 minute loadavg: .
Use of uninitialized value in concatenation (.) or string at ./soms.pl line 17, <LOADAVG> line 1.
Use of uninitialized value in concatenation (.) or string at ./soms.pl line 17, <LOADAVG> line 1.
5 minutes loadavg: .
Use of uninitialized value in concatenation (.) or string at ./soms.pl line 18, <LOADAVG> line 1.
Use of uninitialized value in concatenation (.) or string at ./soms.pl line 18, <LOADAVG> line 1.
10 minutes loadavg: .
Use of uninitialized value in concatenation (.) or string at ./soms.pl line 19, <LOADAVG> line 1.
Running processes:  processes
Use of uninitialized value in concatenation (.) or string at ./soms.pl line 20, <LOADAVG> line 1.
Total processes:  processes

Could you tell me what happens? And how to fix it.

Huge thanks!

Best Regards,

Amy 


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

Date: Fri, 29 Aug 2008 16:52:45 +0200
From: Peter Makholm <peter@makholm.net>
Subject: Re: Help: Variables problem
Message-Id: <87sksng9fm.fsf@hacking.dk>

Amy Lee <openlinuxsource@gmail.com> writes:

> And there's my codes:
>
> open LOADAVG, "<", "/proc/loadavg"
>   or die RED "Can't open /proc/loadavg. $!";

On my system this pseudo file consists of one and only one line

> while (<LOADAVG>)

Which you read into $_ here.

> {
>   <LOADAVG> =~ /(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+(\d+)\/(\d+)\s+\d+/;

As you allready has read the only line in the file this read opration
returns undef. So what you actually do is to try to match on the
undefined string. This fails of course and thus leaves $1 to $9
undefined.

> Could you tell me what happens? And how to fix it.

Try matching the line you just read instead of matching on the next
line.

//Makholm


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

Date: Fri, 29 Aug 2008 23:03:15 +0800
From: Amy Lee <openlinuxsource@gmail.com>
Subject: Re: Help: Variables problem
Message-Id: <pan.2008.08.29.15.03.14.602317@gmail.com>

On Fri, 29 Aug 2008 16:52:45 +0200, Peter Makholm wrote:

> Amy Lee <openlinuxsource@gmail.com> writes:
> 
>> And there's my codes:
>>
>> open LOADAVG, "<", "/proc/loadavg"
>>   or die RED "Can't open /proc/loadavg. $!";
> 
> On my system this pseudo file consists of one and only one line
> 
>> while (<LOADAVG>)
> 
> Which you read into $_ here.
> 
>> {
>>   <LOADAVG> =~ /(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+(\d+)\/(\d+)\s+\d+/;
> 
> As you allready has read the only line in the file this read opration
> returns undef. So what you actually do is to try to match on the
> undefined string. This fails of course and thus leaves $1 to $9
> undefined.
> 
>> Could you tell me what happens? And how to fix it.
> 
> Try matching the line you just read instead of matching on the next
> line.
> 
> //Makholm
Huge thanks to you, I have solved this one.

Amy


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

Date: Thu, 28 Aug 2008 22:26:26 -0700 (PDT)
From: "dn.perl@gmail.com" <dn.perl@gmail.com>
Subject: Re: Internal limit on variable length?
Message-Id: <e0820672-60c1-4a9f-8bed-c07ff340d7f7@v39g2000pro.googlegroups.com>

On Aug 26, 4:10 am, "dn.p...@gmail.com" <dn.p...@gmail.com> wrote:
> I am feeling somewhat uneasy posting my query because quite likely it
> is some other bug which is causing my code to fail and it is only a
> matter of time before I discover it; but I have already spent far too
> much time debugging it. So I might as well try to cover some
> unsuspected source of bug.
>
> The crux of my code is:
>
> my @in_arr ;
> foreach my $in(1 .. 10)  {
>     my $in1 = "aabb" ;
>     my $in2 = "a string longer than 256 chars, say 275 chars" ;
>     my  $in_str = "$in1 \t $in2 " ;
>     push  @in_arr, $in_str ;}
>
> while (my $out_str = pop @in_arr)  {
>     my ($out1, $out2) = split /\t/ , $out_str ;
>     print "out1 is $out1, out2 is $out2 \n" ;
>
> }
>
> The script hangs within the while loop. Could it happen if the value
> of $out2 exceeds 256 characters at some point(s)
> during the code-run?
>

As I had suspected, the cause of the bug was something else.

I wanted 4 distinct integers in the range 1 to max_int. The code was
going in infinite loop when max_int = 4, because I was calling
(int(rand($max_int-1)) + 1), and when I changed it to
(int(rand($max_int)) + 1), the bug went away.

But I was suspecting an internal limit on variable-length because a
debug statement was printing partial string and then hanging. At any
rate, my strings were far too small (max length = 400-500) for this to
be the cause. I had some print statements in my code and it was
hanging with output like:

6 values from Store in Connecticut
5 values from Store in New Mexico \t Near Arizona \t S-W US\t etc
52 values from Sto

(not printing beyond 'Sto')...

Thanks to everybody who responded to my query.




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

Date: Fri, 29 Aug 2008 04:42:24 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri Aug 29 2008
Message-Id: <K6CIEo.1zAK@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

App-Asciio-1.01
http://search.cpan.org/~nkh/App-Asciio-1.01/
Plain ASCII diagram 
----
Archive-Peek-0.32
http://search.cpan.org/~lbrocard/Archive-Peek-0.32/
Peek into archives without extracting them 
----
Archive-Peek-0.33
http://search.cpan.org/~lbrocard/Archive-Peek-0.33/
Peek into archives without extracting them 
----
CPAN-Mini-Webserver-0.41
http://search.cpan.org/~lbrocard/CPAN-Mini-Webserver-0.41/
Search and browse Mini CPAN 
----
Cache-CacheFactory-1.07_01
http://search.cpan.org/~sgraham/Cache-CacheFactory-1.07_01/
factory class for Cache::Cache and other modules. 
----
Catalyst-Authentication-AuthTkt-0.03
http://search.cpan.org/~karman/Catalyst-Authentication-AuthTkt-0.03/
shim for Apache::AuthTkt 
----
Catalyst-Plugin-Authentication-AuthTkt-0.02
http://search.cpan.org/~karman/Catalyst-Plugin-Authentication-AuthTkt-0.02/
**DEPRECATED** shim for Apache::AuthTkt 
----
Chart-Clicker-2.04
http://search.cpan.org/~gphat/Chart-Clicker-2.04/
Powerful, extensible charting. 
----
Class-DBI-ClassGenerator-1.0
http://search.cpan.org/~dcantrell/Class-DBI-ClassGenerator-1.0/
generate Class::DBI sub-class modules from a pre-exsting database's structure. 
----
Class-XSAccessor-0.06
http://search.cpan.org/~smueller/Class-XSAccessor-0.06/
Generate fast XS accessors without runtime compilation 
----
Class-XSAccessor-Array-0.04
http://search.cpan.org/~smueller/Class-XSAccessor-Array-0.04/
Generate fast XS accessors without runtime compilation 
----
Crypt-GpgME-0.05
http://search.cpan.org/~flora/Crypt-GpgME-0.05/
Perl interface to libgpgme 
----
Crypt-GpgME-0.06
http://search.cpan.org/~flora/Crypt-GpgME-0.06/
Perl interface to libgpgme 
----
Crypt-GpgME-0.07
http://search.cpan.org/~flora/Crypt-GpgME-0.07/
Perl interface to libgpgme 
----
DBD-Ingres-0.5209
http://search.cpan.org/~sreagle/DBD-Ingres-0.5209/
DBI driver for Ingres database systems 
----
DBD-ODBC-1.16_1
http://search.cpan.org/~mjevans/DBD-ODBC-1.16_1/
ODBC Driver for DBI 
----
DBIx-Perlish-0.43
http://search.cpan.org/~gruber/DBIx-Perlish-0.43/
a perlish interface to SQL databases 
----
DBIx-Printf-0.07
http://search.cpan.org/~kazuho/DBIx-Printf-0.07/
A printf-style prepared statement 
----
Graphics-Color-0.12
http://search.cpan.org/~gphat/Graphics-Color-0.12/
Device and library agnostic color spaces. 
----
Graphics-Primitive-0.26
http://search.cpan.org/~gphat/Graphics-Primitive-0.26/
Device and library agnostic graphic primitives 
----
Graphics-Primitive-Driver-Cairo-0.16
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-Cairo-0.16/
Cairo backend for Graphics::Primitive 
----
Graphics-Primitive-Driver-Cairo-0.17
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-Cairo-0.17/
Cairo backend for Graphics::Primitive 
----
Graphics-Primitive-Driver-Cairo-0.18
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-Cairo-0.18/
Cairo backend for Graphics::Primitive 
----
Graphics-Primitive-Driver-Cairo-0.19
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-Cairo-0.19/
Cairo backend for Graphics::Primitive 
----
Gtk2-WebKit-0.03
http://search.cpan.org/~flora/Gtk2-WebKit-0.03/
Web content engine library for Gtk2 
----
HTML-DOM-0.016
http://search.cpan.org/~sprout/HTML-DOM-0.016/
A Perl implementation of the HTML Document Object Model 
----
HTTP-Engine-0.0.15
http://search.cpan.org/~yappo/HTTP-Engine-0.0.15/
Web Server Gateway Interface and HTTP Server Engine Drivers (Yet Another Catalyst::Engine) 
----
HTTP-Engine-Compat-0.03
http://search.cpan.org/~yappo/HTTP-Engine-Compat-0.03/
version 0.0.12 Compatibility layer of HTTP::Engine 
----
HTTP-MobileAgent-Plugin-RoamingZone-0.0.1
http://search.cpan.org/~kokogiko/HTTP-MobileAgent-Plugin-RoamingZone-0.0.1/
???????????/?????????????? 
----
IO-Socket-SSL-1.15
http://search.cpan.org/~sullr/IO-Socket-SSL-1.15/
Nearly transparent SSL encapsulation for IO::Socket::INET. 
----
JS-0.17
http://search.cpan.org/~ingy/JS-0.17/
JavaScript Modules on CPAN 
----
JS-Test-Base-0.15
http://search.cpan.org/~ingy/JS-Test-Base-0.15/
----
JS-Test-Base-0.16
http://search.cpan.org/~ingy/JS-Test-Base-0.16/
----
JS-Test-Simple-0.28
http://search.cpan.org/~ingy/JS-Test-Simple-0.28/
----
JS-jQuery-1.2.6.001
http://search.cpan.org/~ingy/JS-jQuery-1.2.6.001/
----
Kephra-0.3.9_15
http://search.cpan.org/~lichtkind/Kephra-0.3.9_15/
crossplatform, GUI-Texteditor along perllike Paradigms 
----
Lingua-Stem-Snowball-0.952
http://search.cpan.org/~creamyg/Lingua-Stem-Snowball-0.952/
Perl interface to Snowball stemmers. 
----
Lingua-Treebank-0.16
http://search.cpan.org/~kahn/Lingua-Treebank-0.16/
Perl extension for manipulating the Penn Treebank format 
----
Locale-Geocode-1.11
http://search.cpan.org/~diz/Locale-Geocode-1.11/
----
PAR-Dist-FromCPAN-0.10
http://search.cpan.org/~smueller/PAR-Dist-FromCPAN-0.10/
Create PAR distributions from CPAN 
----
POE-Component-CPANPLUS-YACSmoke-1.46
http://search.cpan.org/~bingos/POE-Component-CPANPLUS-YACSmoke-1.46/
Bringing the power of POE to CPAN smoke testing. 
----
POE-Component-IRC-5.88
http://search.cpan.org/~bingos/POE-Component-IRC-5.88/
a fully event-driven IRC client module. 
----
POEIKC-0.02_06
http://search.cpan.org/~suzuki/POEIKC-0.02_06/
A framework to make a daemon or P2P with "PoCo::IKC" 
----
Padre-0.06
http://search.cpan.org/~szabgab/Padre-0.06/
Perl Application Development and Refactoring Environment 
----
Paranoid-0.20
http://search.cpan.org/~corliss/Paranoid-0.20/
Paranoia support for safer programs 
----
Parse-PlainConfig-2.06
http://search.cpan.org/~corliss/Parse-PlainConfig-2.06/
Parser for plain-text configuration files 
----
ProgressMonitor-0.28
http://search.cpan.org/~knth/ProgressMonitor-0.28/
a flexible and configurable framework for providing feedback on how a long-running task is proceeding. 
----
ProgressMonitor-0.29
http://search.cpan.org/~knth/ProgressMonitor-0.29/
a flexible and configurable framework for providing feedback on how a long-running task is proceeding. 
----
ProgressMonitor-0.30
http://search.cpan.org/~knth/ProgressMonitor-0.30/
a flexible and configurable framework for providing feedback on how a long-running task is proceeding. 
----
RPC-XML-Parser-LibXML-0.03
http://search.cpan.org/~miyagawa/RPC-XML-Parser-LibXML-0.03/
Fast XML-RPC parser with libxml 
----
SNMP-Class-0.12
http://search.cpan.org/~aduitsis/SNMP-Class-0.12/
A convenience class around the NetSNMP perl modules. 
----
SNMP-Class-0.13
http://search.cpan.org/~aduitsis/SNMP-Class-0.13/
A convenience class around the NetSNMP perl modules. 
----
SNMP-Class-0.14
http://search.cpan.org/~aduitsis/SNMP-Class-0.14/
A convenience class around the NetSNMP perl modules. 
----
Sjis-0.27
http://search.cpan.org/~ina/Sjis-0.27/
Source code filter for ShiftJIS script 
----
SkypeAPI-0.08
http://search.cpan.org/~laomoi/SkypeAPI-0.08/
Skype API simple implementation, only support windows platform now. 
----
Slackware-Slackget-0.17
http://search.cpan.org/~dupuisarn/Slackware-Slackget-0.17/
Main library for slack-get package manager 1.X 
----
Test-TCP-0.02
http://search.cpan.org/~tokuhirom/Test-TCP-0.02/
testing TCP program 
----
Text-SimpleTable-0.04
http://search.cpan.org/~sri/Text-SimpleTable-0.04/
Simple Eyecandy ASCII Tables 
----
Text-SimpleTable-0.05
http://search.cpan.org/~sri/Text-SimpleTable-0.05/
Simple Eyecandy ASCII Tables 
----
UML-Class-Simple-0.14
http://search.cpan.org/~agent/UML-Class-Simple-0.14/
Render simple UML class diagrams, by loading the code 
----
Util-Properties-0.18
http://search.cpan.org/~alexmass/Util-Properties-0.18/
Java.util.properties like class 
----
WSRF-Lite-0.8.2.3
http://search.cpan.org/~ekawas/WSRF-Lite-0.8.2.3/
Implementation of the Web Service Resource Framework 
----
iThenticate-API-Client-0.08
http://search.cpan.org/~phred/iThenticate-API-Client-0.08/
a client class to access the iThenticate API 
----
iThenticate-API-Request-0.06
http://search.cpan.org/~phred/iThenticate-API-Request-0.06/
create request objects for the iThenticate::API 
----
mobirc-1.05
http://search.cpan.org/~tokuhirom/mobirc-1.05/
modern IRC to HTTP gateway 
----
mobirc-1.06
http://search.cpan.org/~tokuhirom/mobirc-1.06/
modern IRC to HTTP gateway 
----
perl-ldap-0.37
http://search.cpan.org/~gbarr/perl-ldap-0.37/
----
subs-auto-0.02
http://search.cpan.org/~vpit/subs-auto-0.02/
Read barewords as subroutine names. 
----
uny2k-19.1080828
http://search.cpan.org/~mschwern/uny2k-19.1080828/
Removes y2k fixes 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

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: Fri, 29 Aug 2008 14:18:06 GMT
From: "NEAL ZIERKE" <deniserz@verizon.net>
Subject: newbie also
Message-Id: <yyTtk.2$393.0@trnddc05>


I'm just learning perl, so that said.

question is.


If I have file names in directory like /mydir/abcd12e.fgh ,,, in unix system

I wish to test the "12" part of filenames. I understand and lot of examples 
on net for directory stuff ( File::Find::name )

I wish to test against other file names that will look the same but the 12 
would be different ( this is the version of the file ) , say it might look 
like this /mydir/abcd45e.fgh, where as this is newest version.

What is the easiest way to test those 2 char's of file name in perl




So like




use File::Find;

find(\&myprocessing,"startdir");




sub myprocessing

{

if ( "test the "12" vs the "45" )

{

"move the new to old file code "

}




}







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

Date: Fri, 29 Aug 2008 15:48:03 +0100
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: Perl Newbie
Message-Id: <g99272$65c$1@south.jnrs.ja.net>

Rob Hoyer wrote:
> Hello,
> 
> I am using a free script from thesitewizard.com to sendmail a feedback form.
> 
> Everything was working great but I need more input fields on the form.  The 
> HTML was no problem but I busted the script.

It seems that you are unable to show the full script you are working 
with.  I'd therefore suggest the use of an open, and well reviewed 
solution to the same problem:

http://nms-cgi.sourceforge.net/

 ..specifically the FormMail script at the top of:

http://nms-cgi.sourceforge.net/scripts.shtml

 ..which includes plenty of documentation and examples to help you do do 
what you need.

Simon.


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

Date: Fri, 29 Aug 2008 07:14:17 GMT
From: tadmc@seesig.invalid
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)
Message-Id: <dlNtk.38667$ZE5.3731@nlpi061.nbdc.sbc.com>

Outline
   Before posting to comp.lang.perl.misc
      Must
       - Check the Perl Frequently Asked Questions (FAQ)
       - Check the other standard Perl docs (*.pod)
      Really Really Should
       - Lurk for a while before posting
       - Search a Usenet archive
      If You Like
       - Check Other Resources
   Posting to comp.lang.perl.misc
      Is there a better place to ask your question?
       - Question should be about Perl, not about the application area
      How to participate (post) in the clpmisc community
       - Carefully choose the contents of your Subject header
       - Use an effective followup style
       - Speak Perl rather than English, when possible
       - Ask perl to help you
       - Do not re-type Perl code
       - Provide enough information
       - Do not provide too much information
       - Do not post binaries, HTML, or MIME
      Social faux pas to avoid
       - Asking a Frequently Asked Question
       - Asking a question easily answered by a cursory doc search
       - Asking for emailed answers
       - Beware of saying "doesn't work"
       - Sending a "stealth" Cc copy
      Be extra cautious when you get upset
       - Count to ten before composing a followup when you are upset
       - Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------

Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)
    This newsgroup, commonly called clpmisc, is a technical newsgroup
    intended to be used for discussion of Perl related issues (except job
    postings), whether it be comments or questions.

    As you would expect, clpmisc discussions are usually very technical in
    nature and there are conventions for conduct in technical newsgroups
    going somewhat beyond those in non-technical newsgroups.

    The article at:

        http://www.catb.org/~esr/faqs/smart-questions.html

    describes how to get answers from technical people in general.

    This article describes things that you should, and should not, do to
    increase your chances of getting an answer to your Perl question. It is
    available in POD, HTML and plain text formats at:

     http://www.rehabitation.com/clpmisc.shtml

    For more information about netiquette in general, see the "Netiquette
    Guidelines" at:

     http://andrew2.andrew.cmu.edu/rfc/rfc1855.html

    A note to newsgroup "regulars":

       Do not use these guidelines as a "license to flame" or other
       meanness. It is possible that a poster is unaware of things
       discussed here.  Give them the benefit of the doubt, and just
       help them learn how to post, rather than assume that they do 
       know and are being the "bad kind" of Lazy.

    A note about technical terms used here:

       In this document, we use words like "must" and "should" as
       they're used in technical conversation (such as you will
       encounter in this newsgroup). When we say that you *must* do
       something, we mean that if you don't do that something, then
       it's unlikely that you will benefit much from this group.
       We're not bossing you around; we're making the point without
       lots of words.

    Do *NOT* send email to the maintainer of these guidelines. It will be
    discarded unread. The guidelines belong to the newsgroup so all
    discussion should appear in the newsgroup. I am just the secretary that
    writes down the consensus of the group.

Before posting to comp.lang.perl.misc
  Must
    This section describes things that you *must* do before posting to
    clpmisc, in order to maximize your chances of getting meaningful replies
    to your inquiry and to avoid getting flamed for being lazy and trying to
    have others do your work.

    The perl distribution includes documentation that is copied to your hard
    drive when you install perl. Also installed is a program for looking
    things up in that (and other) documentation named 'perldoc'.

    You should either find out where the docs got installed on your system,
    or use perldoc to find them for you. Type "perldoc perldoc" to learn how
    to use perldoc itself. Type "perldoc perl" to start reading Perl's
    standard documentation.

    Check the Perl Frequently Asked Questions (FAQ)
        Checking the FAQ before posting is required in Big 8 newsgroups in
        general, there is nothing clpmisc-specific about this requirement.
        You are expected to do this in nearly all newsgroups.

        You can use the "-q" switch with perldoc to do a word search of the
        questions in the Perl FAQs.

    Check the other standard Perl docs (*.pod)
        The perl distribution comes with much more documentation than is
        available for most other newsgroups, so in clpmisc you should also
        see if you can find an answer in the other (non-FAQ) standard docs
        before posting.

    It is *not* required, or even expected, that you actually *read* all of
    Perl's standard docs, only that you spend a few minutes searching them
    before posting.

    Try doing a word-search in the standard docs for some words/phrases
    taken from your problem statement or from your very carefully worded
    "Subject:" header.

  Really Really Should
    This section describes things that you *really should* do before posting
    to clpmisc.

    Lurk for a while before posting
        This is very important and expected in all newsgroups. Lurking means
        to monitor a newsgroup for a period to become familiar with local
        customs. Each newsgroup has specific customs and rituals. Knowing
        these before you participate will help avoid embarrassing social
        situations. Consider yourself to be a foreigner at first!

    Search a Usenet archive
        There are tens of thousands of Perl programmers. It is very likely
        that your question has already been asked (and answered). See if you
        can find where it has already been answered.

        One such searchable archive is:

         http://groups.google.com/advanced_group_search

  If You Like
    This section describes things that you *can* do before posting to
    clpmisc.

    Check Other Resources
        You may want to check in books or on web sites to see if you can
        find the answer to your question.

        But you need to consider the source of such information: there are a
        lot of very poor Perl books and web sites, and several good ones
        too, of course.

Posting to comp.lang.perl.misc
    There can be 200 messages in clpmisc in a single day. Nobody is going to
    read every article. They must decide somehow which articles they are
    going to read, and which they will skip.

    Your post is in competition with 199 other posts. You need to "win"
    before a person who can help you will even read your question.

    These sections describe how you can help keep your article from being
    one of the "skipped" ones.

  Is there a better place to ask your question?
    Question should be about Perl, not about the application area
        It can be difficult to separate out where your problem really is,
        but you should make a conscious effort to post to the most
        applicable newsgroup. That is, after all, where you are the most
        likely to find the people who know how to answer your question.

        Being able to "partition" a problem is an essential skill for
        effectively troubleshooting programming problems. If you don't get
        that right, you end up looking for answers in the wrong places.

        It should be understood that you may not know that the root of your
        problem is not Perl-related (the two most frequent ones are CGI and
        Operating System related), so off-topic postings will happen from
        time to time. Be gracious when someone helps you find a better place
        to ask your question by pointing you to a more applicable newsgroup.

  How to participate (post) in the clpmisc community
    Carefully choose the contents of your Subject header
        You have 40 precious characters of Subject to win out and be one of
        the posts that gets read. Don't waste them. Take care while
        composing them, they are the key that opens the door to getting an
        answer.

        Spend them indicating what aspect of Perl others will find if they
        should decide to read your article.

        Do not spend them indicating "experience level" (guru, newbie...).

        Do not spend them pleading (please read, urgent, help!...).

        Do not spend them on non-Subjects (Perl question, one-word
        Subject...)

        For more information on choosing a Subject see "Choosing Good
        Subject Lines":

         http://www.cpan.org/authors/id/D/DM/DMR/subjects.post

        Part of the beauty of newsgroup dynamics, is that you can contribute
        to the community with your very first post! If your choice of
        Subject leads a fellow Perler to find the thread you are starting,
        then even asking a question helps us all.

    Use an effective followup style
        When composing a followup, quote only enough text to establish the
        context for the comments that you will add. Always indicate who
        wrote the quoted material. Never quote an entire article. Never
        quote a .signature (unless that is what you are commenting on).

        Intersperse your comments *following* each section of quoted text to
        which they relate. Unappreciated followup styles are referred to as
        "top-posting", "Jeopardy" (because the answer comes before the
        question), or "TOFU" (Text Over, Fullquote Under).

        Reversing the chronology of the dialog makes it much harder to
        understand (some folks won't even read it if written in that style).
        For more information on quoting style, see:

         http://web.presby.edu/~nnqadmin/nnq/nquote.html

    Speak Perl rather than English, when possible
        Perl is much more precise than natural language. Saying it in Perl
        instead will avoid misunderstanding your question or problem.

        Do not say: I have variable with "foo\tbar" in it.

        Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
        or I have $var = <DATA> (and show the data line).

    Ask perl to help you
        You can ask perl itself to help you find common programming mistakes
        by doing two things: enable warnings (perldoc warnings) and enable
        "strict"ures (perldoc strict).

        You should not bother the hundreds/thousands of readers of the
        newsgroup without first seeing if a machine can help you find your
        problem. It is demeaning to be asked to do the work of a machine. It
        will annoy the readers of your article.

        You can look up any of the messages that perl might issue to find
        out what the message means and how to resolve the potential mistake
        (perldoc perldiag). If you would like perl to look them up for you,
        you can put "use diagnostics;" near the top of your program.

    Do not re-type Perl code
        Use copy/paste or your editor's "import" function rather than
        attempting to type in your code. If you make a typo you will get
        followups about your typos instead of about the question you are
        trying to get answered.

    Provide enough information
        If you do the things in this item, you will have an Extremely Good
        chance of getting people to try and help you with your problem!
        These features are a really big bonus toward your question winning
        out over all of the other posts that you are competing with.

        First make a short (less than 20-30 lines) and *complete* program
        that illustrates the problem you are having. People should be able
        to run your program by copy/pasting the code from your article. (You
        will find that doing this step very often reveals your problem
        directly. Leading to an answer much more quickly and reliably than
        posting to Usenet.)

        Describe *precisely* the input to your program. Also provide example
        input data for your program. If you need to show file input, use the
        __DATA__ token (perldata.pod) to provide the file contents inside of
        your Perl program.

        Show the output (including the verbatim text of any messages) of
        your program.

        Describe how you want the output to be different from what you are
        getting.

        If you have no idea at all of how to code up your situation, be sure
        to at least describe the 2 things that you *do* know: input and
        desired output.

    Do not provide too much information
        Do not just post your entire program for debugging. Most especially
        do not post someone *else's* entire program.

    Do not post binaries, HTML, or MIME
        clpmisc is a text only newsgroup. If you have images or binaries
        that explain your question, put them in a publically accessible
        place (like a Web server) and provide a pointer to that location. If
        you include code, cut and paste it directly in the message body.
        Don't attach anything to the message. Don't post vcards or HTML.
        Many people (and even some Usenet servers) will automatically filter
        out such messages. Many people will not be able to easily read your
        post. Plain text is something everyone can read.

  Social faux pas to avoid
    The first two below are symptoms of lots of FAQ asking here in clpmisc.
    It happens so often that folks will assume that it is happening yet
    again. If you have looked but not found, or found but didn't understand
    the docs, say so in your article.

    Asking a Frequently Asked Question
        It should be understood that you may have missed the applicable FAQ
        when you checked, which is not a big deal. But if the Frequently
        Asked Question is worded similar to your question, folks will assume
        that you did not look at all. Don't become indignant at pointers to
        the FAQ, particularly if it solves your problem.

    Asking a question easily answered by a cursory doc search
        If folks think you have not even tried the obvious step of reading
        the docs applicable to your problem, they are likely to become
        annoyed.

        If you are flamed for not checking when you *did* check, then just
        shrug it off (and take the answer that you got).

    Asking for emailed answers
        Emailed answers benefit one person. Posted answers benefit the
        entire community. If folks can take the time to answer your
        question, then you can take the time to go get the answer in the
        same place where you asked the question.

        It is OK to ask for a *copy* of the answer to be emailed, but many
        will ignore such requests anyway. If you munge your address, you
        should never expect (or ask) to get email in response to a Usenet
        post.

        Ask the question here, get the answer here (maybe).

    Beware of saying "doesn't work"
        This is a "red flag" phrase. If you find yourself writing that,
        pause and see if you can't describe what is not working without
        saying "doesn't work". That is, describe how it is not what you
        want.

    Sending a "stealth" Cc copy
        A "stealth Cc" is when you both email and post a reply without
        indicating *in the body* that you are doing so.

  Be extra cautious when you get upset
    Count to ten before composing a followup when you are upset
        This is recommended in all Usenet newsgroups. Here in clpmisc, most
        flaming sub-threads are not about any feature of Perl at all! They
        are most often for what was seen as a breach of netiquette. If you
        have lurked for a bit, then you will know what is expected and won't
        make such posts in the first place.

        But if you get upset, wait a while before writing your followup. I
        recommend waiting at least 30 minutes.

    Count to ten after composing and before posting when you are upset
        After you have written your followup, wait *another* 30 minutes
        before committing yourself by posting it. You cannot take it back
        once it has been said.

AUTHOR
    Tad McClellan and many others on the comp.lang.perl.misc newsgroup.

-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Fri, 29 Aug 2008 05:19:55 -0700 (PDT)
From: "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: subprocesses lifecycle
Message-Id: <3b9a2493-307f-4f17-9a5d-5ab4539cec27@s9g2000prg.googlegroups.com>

On Aug 28, 10:43 am, Hans Mulder <han...@xs4all.nl> wrote:
> Matthieu Imbert wrote:
> > But it does not explain why in your example the parent script returns
> > immediately when calling die, while in my case the parent script waits
> > for children to end before returning. I thought that this could be
> > related to the way you create child processes (with fork), whereas i
> > create then with open. But this little test script returns immediately:
>
> > perl -e '
> > open (CHILD,"sleep 30 |");
> > die "byebye";
> > '
>
> By contrast, if I do this:
>
> perl -e '
> open my $child ,"sleep 30 |";
> die "byebye";
> '
> , then I have to wait 30 seconds.
>
> It looks like when my $child goes out of scope, perl closes the handle
> and this implies waiting for the child to finish and then setting $?.
>
> I would have thought your example should behave the same, but it doesn't
> (not on my machine anyway).
>
> Perhaps you need a double fork.  That is, your child could fork and then
> the original child exits immediately, letting the grandchild to the real
> work.  That way, your script won't have to wait when it decides to close
> the $child handle.
>
> What you'd really want, is a way to tell C<open> that you don't want
> C<close> to wait for this child.  As far as I know, there is currently
> no simple way to achieve that.
>

Wouldn't backgrounding the task
accomplish that:

open my $fd, "/some/task & |"
  or die...

However, child subprocesses would then need to be foregrounded with
SIGCONT if the parent wants to kill them before exiting.


--
Charles DeRykus


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

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 V11 Issue 1826
***************************************


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