[19666] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1861 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 3 09:05:40 2001

Date: Wed, 3 Oct 2001 06:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1002114308-v10-i1861@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 3 Oct 2001     Volume: 10 Number: 1861

Today's topics:
    Re: Accessing Files on Client PC nobull@mail.com
        Calling function with hash values as key-value argument <joonas@olen.to>
    Re: Calling function with hash values as key-value argu (Rafael Garcia-Suarez)
    Re: Calling function with hash values as key-value argu <info@fruiture.de>
    Re: Calling function with hash values as key-value argu <joonas@olen.to>
    Re: filehandles between functions <iltzu@sci.invalid>
    Re: Finding installed modules ie MD5.pm <kalinabears@hdc.com.au>
    Re: GIF encoding (Martien Verbruggen)
    Re: many file search and replace (Windows) <magrav@wnt.sas.com>
    Re: passing parameters between perl cgi scripts <eramaqu@set132.gsm.ericsson.se>
    Re: Pattern Matching <iltzu@sci.invalid>
        Perl and Solaris Version Upgrade <laurent.galster@swisscom.com>
    Re: Perl and Solaris Version Upgrade <tintin@snowy.calculus>
        perl script to summarize mail log (PM WONG)
    Re: perl script to summarize mail log <info@fruiture.de>
    Re: Please advise on directions <iltzu@sci.invalid>
        resetting variables (rolf deenen)
    Re: resetting variables (Rafael Garcia-Suarez)
    Re: resetting variables <wolfram.pfeiffer@bigfoot.com>
    Re: strict and undisciplined me <bart.lateur@skynet.be>
    Re: strict and undisciplined me nobull@mail.com
    Re: Yet another fork question <djberge@qwest.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 03 Oct 2001 12:50:30 +0100
From: nobull@mail.com
Subject: Re: Accessing Files on Client PC
Message-Id: <u94rphx7qx.fsf@wcl-l.bham.ac.uk>

"Niall" <Niall.e@no.usa.spam.net> writes:

> Is it possible to use perl to check for a file on the client machine.
> 
> We want a client to visit a website. This website has to be check that a
> file exists, and then launch that file.

Think what you are asking!  What you are asking is "can web sites I
visit look at the contents of my local disk and run arbitrary programs
on my machine?".

The answer is only if you have some serious security flaws in your web
browser.  Exploiting such flaws is a crime in many countries.

The choice of programming language used on the _server_ side is not
relevant.

If you want a seb site that involved running non-trival code on the
client side you should probably be using Java (not JavaScript).

This is not a Perl question.  If you need help I think you should go
to a group that deals with web programming.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 03 Oct 2001 09:38:24 GMT
From: Joonas Paalasmaa <joonas@olen.to>
Subject: Calling function with hash values as key-value arguments
Message-Id: <3BBADD06.B3E035CD@olen.to>

I have variable sized hash %hash and i want to call a function with it's
values as key-value args.
my %hash = {"first" => "1",
            "second" => "2"};


So how can I call the function with arguments passed like below.

function("first" => "1",
         "second" => "2");


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

Date: 3 Oct 2001 11:12:50 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Calling function with hash values as key-value arguments
Message-Id: <slrn9rlsl2.9gn.rgarciasuarez@rafael.kazibao.net>

Joonas Paalasmaa wrote in comp.lang.perl.misc:
} I have variable sized hash %hash and i want to call a function with it's
} values as key-value args.
} my %hash = {"first" => "1",
}             "second" => "2"};

You meant %hash = (...) or $hashreference = { ... } here.

} So how can I call the function with arguments passed like below.
} 
} function("first" => "1",
}          "second" => "2");

Simply function(%hash)

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Wed, 3 Oct 2001 13:18:14 +0200
From: "fruiture" <info@fruiture.de>
Subject: Re: Calling function with hash values as key-value arguments
Message-Id: <9pesag$nf5$07$1@news.t-online.com>

"Joonas Paalasmaa" <joonas@olen.to> wrote:
> I have variable sized hash %hash and i want to call a function with it's
> values as key-value args.
> my %hash = {"first" => "1",
>             "second" => "2"};
>
>
> So how can I call the function with arguments passed like below.
>
> function("first" => "1",
>          "second" => "2");

function( %hash ); #that's why i love Perl

--
require Time::HiRes;my @m=split(/8/,55.52.56.49.49.55.56.49.49.53);push
@m,map{($_%2)?$_-1:$_+1} map ord($_),split//,'u!`onuids!Qdsm!i`bjds';
unshift @m,43 for(0..@m);for(0..@m){print map chr($_),@m[0..(@m/2-1)];
push @m,shift @m;print "\b"x(@m/2);Time::HiRes::usleep(0246*0xA**3);}



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

Date: Wed, 03 Oct 2001 12:35:32 GMT
From: Joonas Paalasmaa <joonas@olen.to>
Subject: Re: Calling function with hash values as key-value arguments
Message-Id: <3BBB0698.2AD1F96@olen.to>

fruiture wrote:
> 
> "Joonas Paalasmaa" <joonas@olen.to> wrote:
> > I have variable sized hash %hash and i want to call a function with it's
> > values as key-value args.
> > my %hash = {"first" => "1",
> >             "second" => "2"};
> >
> >
> > So how can I call the function with arguments passed like below.
> >
> > function("first" => "1",
> >          "second" => "2");
> 
> function( %hash ); #that's why i love Perl

What should I do if I the first argument is normal argument and the
following arguments are
key-value pairs.
Like:

function(firstarg, "first" => "1", "second" => "2");


Btw I am using this to pass arguments to XML-Writer's startTag function,
where key-values are
pairs for xml tags' attributes.


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

Date: 3 Oct 2001 12:20:28 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: filehandles between functions
Message-Id: <1002110362.18804@itz.pp.sci.fi>

In article <x74rph9xvo.fsf@home.sysarch.com>, Uri Guttman wrote:
>>>>>> "GW" == Garry Williams <garry@ifr.zvolve.net> writes:
>
>  GW>   sub read_file {
>  GW>     open( my $fh, $infile ) || die "can't open '$infile': $!\n";
>  GW>     chomp( my @lines = <$fh> );
>  GW>     return join "", @lines;
>  GW>   }
>
>if you want to slurp a file, this is a useful sub
>
>sub read_file {
>	my( $file_name ) = shift ;
>	my( $buf ) ;
>	local( *FH ) ;
>	open( FH, $file_name ) || carp "can't open $file_name $!" ;
>	return <FH> if wantarray ;
>	read( FH, $buf, -s FH ) ;
>	return $buf ;
>
># older slow way
>#	local( $/ ) unless wantarray ;
>#	<FH>
>}

Another variant, which works for pipes and other funny things too:

  sub slurp ($) {
      my $fh = shift;
      return <$fh> if wantarray;
      local $/;
      return <$fh> unless -s $fh;
      read $fh, my $buf, -s _;
      return $buf;
  }

This one takes a filehandle, not a filename.  If you don't want to open
the file yourself, just add a wrapper:

  sub read_file ($) {
      my $file = shift;
      local *FH;
      open FH, $file or do {
          my $err = $!;  # require() may reset $!
          require Carp;
          Carp::confess("Can't open '$file': $err\n");
      };
      return slurp(\*FH);
  }

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



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

Date: Wed, 3 Oct 2001 22:31:17 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: Finding installed modules ie MD5.pm
Message-Id: <1002112317.712132@caeser.origin.net.au>


"John P" <john@trumpetweb.co.uk> wrote in message
news:CbAu7.43832$iG3.2848803@news1.cableinet.net...
> Hi there all,
>
> I have MD5.pm installed on my server, I have the correct SHEBANG line but
> I'm still getting
> Can't locate Digest/MD5.pm  message when I run the script. Does anyone
have
> any ideas please.
>
> Thanks in advance
>
>

Sounds like you may have installed the MD5 module instead of the Digest::MD5
module.

The MD5 module requires the Digest::MD5 module.

Simply install Digest::MD5 and forget about the (depreciated) MD5 module.

Cheers,
Rob




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

Date: Wed, 3 Oct 2001 21:56:50 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: GIF encoding
Message-Id: <slrn9rlv82.d6o.mgjv@martien.heliotrope.home>

On Wed, 03 Oct 2001 09:21:24 +0200,
	Philip Newton <pne-news-20011003@newton.digitalspace.net> wrote:
> On Wed, 3 Oct 2001 01:32:11 +1000, "Gregory Toomey" <nobody@nowhere.com>
> wrote:
> 
> [producing GIFs with GD]
>> You need to use an older version of GD (which will be a problem if your
>> default GD is after 1.19)
> 
> This also needs an older version of libgd. Or does GD.pm come with a
> suitable version of libgd? I thought it expected you to install it
> yourself and then just linked to it. And I don't think Thomas Boutell
> has the older, GIF-producing version of libgd available for download any
> more.

Thomas Boutell does not have the older versions available, and CPAN
should have older versions of GD available either.

What people don't seem to realise is that _if_ they use and install that
older version of libgd and/or GD, that _they_ (the users) are
responsible for obtaining the correct license from Unisys to be able to
produce LZW compressed GIF. The fact that that code was written before
Unisys changed their mind has nothing to do with it. If YOU, the user,
are producing LZW compressed GIF right now, then YOU, the user, are
responsible for making sure that your software is covered by at least
one license from Unisys. 

Commercial software will be licensed. Free software won't. You will ave
to license with Unisys, or you coul dbe in trouble, if they decide to
target you.

The best solution is to forget about bloody GIF. It's a crappy format
even _with_ LZW compression, let alone without it. If your users still
have a browser that doesn't read basic PNG, tell them that they should
upgrade. They also have some security and memory bugs.

> So unless GD.pm came with its own libgd, it wouldn't help you to use an
> old one.

And unless you already have a license to use the LZW compression
algorithm, you better get one.

Martien

PS. When people ask for the old GD modules again, use this argument. It
seems to make more sense to many people than simply stating that it will
be 'hard' to get old versions.
-- 
Martien Verbruggen              | 
Interactive Media Division      | In the fight between you and the
Commercial Dynamics Pty. Ltd.   | world, back the world - Franz Kafka
NSW, Australia                  | 


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

Date: Wed, 03 Oct 2001 08:08:49 -0400
From: Max Gravitt <magrav@wnt.sas.com>
Subject: Re: many file search and replace (Windows)
Message-Id: <1rvlrtoodid6onll4l50l6vru7ai6i7q0t@4ax.com>

That worked, but it would not allow me to use wildcards when
specifying the file names.. . for example....

perl -pi.bak -e "s/oldstring/newstring/g" *.txt

 ...gives the error "Can't open *.txt: No such file or directory".


On 2 Oct 2001 13:43:42 -0800, yf110@vtn1.victoria.tc.ca (Malcolm
Dew-Jones) wrote:

>Max Gravitt (magrav@wnt.sas.com) wrote:
>
>: I'm trying to find a perl command that will do a multiple file search
>: and replace on Windows.  This one works on Unix:
>
>: perl -pi.bak -e 's/oldstring/newstring/g' FILES
>
>: But it does not work on Windows NT with perl 5.  I'm not sure why.
>: Does anyone know of a solution to this problem?
>
>Perhaps the quotes are wrong?
>
>
>	perl -pi.bak -e "s/oldstring/newstring/g" m.1 m.2 m.3
>
>the just above worked for me



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

Date: Wed, 03 Oct 2001 12:06:08 +0200
From: Martin Quensel <eramaqu@set132.gsm.ericsson.se>
Subject: Re: passing parameters between perl cgi scripts
Message-Id: <3BBAE310.64B6826D@set132.gsm.ericsson.se>

hugo wrote:
[snip]
> I thought something like this. If there is a link to the second script
> in the first one:
> 
> <a
> href=\"http://www.myserver.com.au/cgi-bin/second_script.pl?$user\">second
> page</a>
> 
> But the addition ?$user to the end of the URL does not work.
[snip]

arguments come in name, value pairs.
You have to pass something like "user=kalle".

But the use of POST is sometimes better than GET. Also, you have to
worry about things like $user containing "bla bla bla" (whitespace) and
other nice things that sometimes can not be passed in URLS.

Best Regards
Martin Q


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

Date: 3 Oct 2001 11:33:29 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Pattern Matching
Message-Id: <1002106025.14709@itz.pp.sci.fi>

In article <3BB9F893.EFEF25E5@acm.org>, Dave Tweed wrote:
>Ilmari Karonen wrote:
>> One possible approach is to prepare a substring index of the longer
>> strings.
>
>perldoc -f study
>
>Unfortunately, this only works for one target string at a time, so you
>need to plan your activities accordingly. It's pretty effective, though;
>I use it when auto-inserting links into HTML documents.

You know, it occurs to me that this just *might* be an answer to the
original problem.

  my $huge_string = join "\0", keys %one, keys %two;
  study $huge_string;

  $huge_string =~ /\Q$_/ and undef $seen{$_}  for keys %three;

I've chosen to join the strings with "\0" on the assumption that none of
the keys in %three contain that character.  If that assumption turns out
to be wrong, there may be some false positives.


(Note: If you only want to add a key to a hash, "undef $seen{$_}" is
faster and takes less memory than "$seen{$_} = 1".  The only problem is
that you'll have to use exists() if you want to test for the existence
of a given key in the hash, since the value will be undefined.)

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



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

Date: Wed, 3 Oct 2001 11:45:55 +0000 (UTC)
From: "Laurent Galster" <laurent.galster@swisscom.com>
Subject: Perl and Solaris Version Upgrade
Message-Id: <01c14c00$f29cfc50$8d4e310a@u45198>

Hello, 
We need to upgrade our solaris version from 2.5.1 to xx. 
The new version number will depend on all other tools that we use. 

Could you please send me a list of compatibilities between Perl versions
and Solaris versions. e.g.: 
Solaris 2.5.1 	- Perl 5.005_02 
Solaris 2.6 	- ?? 
Solaris 7 	- ?? 
Solaris 8 	- ?? 
Solaris 9 (Beta) - ?? 

Thanks for your help. 
Laurent 





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

Date: Wed, 3 Oct 2001 22:50:59 +1000
From: "Tintin" <tintin@snowy.calculus>
Subject: Re: Perl and Solaris Version Upgrade
Message-Id: <YRDu7.16$Zr3.809063@news.interact.net.au>


"Laurent Galster" <laurent.galster@swisscom.com> wrote in message
news:01c14c00$f29cfc50$8d4e310a@u45198...
> Hello,
> We need to upgrade our solaris version from 2.5.1 to xx.
> The new version number will depend on all other tools that we use.
>
> Could you please send me a list of compatibilities between Perl versions
> and Solaris versions. e.g.:
> Solaris 2.5.1 - Perl 5.005_02
> Solaris 2.6 - ??
> Solaris 7 - ??
> Solaris 8 - ??
> Solaris 9 (Beta) - ??


Every version of Perl should work with every version of Solaris.




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

Date: 3 Oct 2001 22:23:21 GMT
From: s11976@net2.hkbu.edu.hk (PM WONG)
Subject: perl script to summarize mail log
Message-Id: <9pg34p$f16$1@net44p.hkbu.edu.hk>

Looking for a perl script (or sh script will do if it works)
to give a summary of 
Sender  Recipient   date/time   status(ok or not)

by scanning the /var/spool/mqueue/syslog

We run sendmail 8.9.x


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

Date: Wed, 3 Oct 2001 12:33:47 +0200
From: "fruiture" <info@fruiture.de>
Subject: Re: perl script to summarize mail log
Message-Id: <9pepn6$s51$02$1@news.t-online.com>

"PM WONG" <s11976@net2.hkbu.edu.hk> wrote:
> Looking for a perl script (or sh script will do if it works)
> to give a summary of 
> Sender  Recipient   date/time   status(ok or not)
> 
> by scanning the /var/spool/mqueue/syslog

how does this logfile look like? (i'm using windows)

-- 
require Time::HiRes;my @m=split(/8/,55.52.56.49.49.55.56.49.49.53);push
@m,map{($_%2)?$_-1:$_+1} map ord($_),split//,'u!`onuids!Qdsm!i`bjds';
unshift @m,43 for(0..@m);for(0..@m){print map chr($_),@m[0..(@m/2-1)];
push @m,shift @m;print "\b"x(@m/2);Time::HiRes::usleep(0246*0xA**3);}



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

Date: 3 Oct 2001 11:56:09 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Please advise on directions
Message-Id: <1002109821.18319@itz.pp.sci.fi>

In article <L8ru7.9323$Ve4.1455298@news20.bellglobal.com>, Michael Greenberg wrote:
 [snip]
>should I look and what should I read to make the proggy go and retrieve this
>page every 1 hour. lets say. Sockets, TCP/IP or this is not where I should
>look?

For retrieving the page, use LWP.  Or, alternatively, use an external
program like wget or lynx.  The *last* thing you want to do is code your
own HTTP client from scratch.

  http://search.cpan.org/search?dist=libwww-perl

For repeating the process every hour, others have already suggested
cron.  If you're not using some Unix variant, your OS probably has some
other comparable scheduling tool you can use.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



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

Date: 3 Oct 2001 03:32:31 -0700
From: rdeenen@mollymail.com (rolf deenen)
Subject: resetting variables
Message-Id: <5b51a4e6.0110030232.6eea9339@posting.google.com>

Hello group,

Simple question. In a cgi-script i wrote to store web-links i want to
clear some variables at the end of the script so that when a user
refreshes the page the freshly added new entry doesn't get added
again. How can I do this. It's a hash I want to clear completely....

Thanks in advance
Rolf Deenen

PS. I already looked at perldoc.com and found something about "undef"
and "delete" but with only limited experience i wasn't able to use
them succesfully....


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

Date: 3 Oct 2001 11:16:04 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: resetting variables
Message-Id: <slrn9rlsr4.9gn.rgarciasuarez@rafael.kazibao.net>

rolf deenen wrote in comp.lang.perl.misc:
} 
} Simple question. In a cgi-script i wrote to store web-links i want to
} clear some variables at the end of the script so that when a user
} refreshes the page the freshly added new entry doesn't get added
} again. How can I do this. It's a hash I want to clear completely....

CGI programs are executed each time the corresponding page(s) is
requested. In other words, the same instance of the running program is
not reused for two pages. So you don't need to clear any variable at the
end of your script.

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: 3 Oct 2001 11:28:25 GMT
From: Wolfram Pfeiffer <wolfram.pfeiffer@bigfoot.com>
Subject: Re: resetting variables
Message-Id: <9pesop$6e4$1@news.rz.uni-karlsruhe.de>

rolf deenen <rdeenen@mollymail.com> wrote:
> Simple question. In a cgi-script i wrote to store web-links i want to
> clear some variables at the end of the script so that when a user
> refreshes the page the freshly added new entry doesn't get added
> again. How can I do this. It's a hash I want to clear completely....

undef %hash; 
is probably what you are looking for.

You should also modify your script to disallow duplicate entries.

-Wolfram


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

Date: Wed, 03 Oct 2001 11:31:07 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: strict and undisciplined me
Message-Id: <gatlrt05pbv8b6l5hb24fdk9t28nqdhfum@4ax.com>

Just in wrote:

>So sorry my system hung, so I didn't finish:-
>
>The error is this:- 'Use of uninitialized value in join at
>C:\Perl\programs\Insert.pl line 56.'

I'm not sure which is line 56, but:

> while($DB->FetchRow())
> {
>  undef my %Data;
>  undef @Insert;
>  %Data = $DB->DataHash();
>
>  while((my $Key, my $Val) = each(%Data))
>  {
>   push @Insert, $Val, "\t";
>  }
>  print "@Insert\n";
^^^^^^ ^^^^ ^^^^^ <- line 56?
> }

It seems to me as if one of your fields is undefined. Now, for the
Perl<->dB connections I'm aware of, undef() is used as a value where the
database field contains a NULL.

If the latter is normal, there's nothing you can do about it except
either suppress the warning, or replace every undef with the empty
string.

Suppress:

	{
	     local $^W;
	     print "@Insert\n";
	}

Replace with empty string:

	push @Insert, ($Val || defined($Val)?$Val:""), "\t";

Besides, why aren't you just doing

	{
	     my @insert = values %data;
	     local $^W;
	     local $" = "\t";
	     print "@insert\n";
	}
or

	{
	     local $^W;
	     local($\, $,) = ("\n", "\t"); #may be put in front the loop
	     print values %data;
	}

-- 
	Bart.


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

Date: 03 Oct 2001 12:50:51 +0100
From: nobull@mail.com
Subject: Re: strict and undisciplined me
Message-Id: <u93d51x7qc.fsf@wcl-l.bham.ac.uk>

"Just in" <justin.devanandan.allegakoen@intel.com> writes:

> I fail to understand why I get
> Use of uninitialized value in join at C:\Perl\programs\program.pl line 55.'
> when all I have done is this :-
> 
> #!/usr/bin/perl5 -w

Yes, I fail to understand it too.  I suspect you are lying.  I suspect
your program really contains at least 55 lines and that somwhere in a
statement that starts on the 55th line there is an expression that is
being used in a numeric or string context and which yeilds the
undefined value.

Note that as of 5.6.0 the -w flag is obsolete and replaced by the 'use
warnings' pragma that allows finer control over warnings.  If you
happen to feel that you'd rather that the undefined value would
silently behave as a null string then you can ask to have this without
disabling other warnings.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 3 Oct 2001 07:28:12 -0500
From: "Mr. Sunblade" <djberge@qwest.com>
Subject: Re: Yet another fork question
Message-Id: <jrDu7.82$2b3.76013@news.uswest.net>


"Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
news:3BBA80A6.332296F0@earthlink.net...
<snip>
> The obvious fault is that you should be doing:
> for( 1..3 ) {
>   defined(my $pid = fork()) or die "fork: $!";
>   if(!$pid) {
>     ... do child stuff ...
>   }
> }
> for( 1..3 ) {
>   wait;
> }
>
> Note that the wait()ing is all done *after* you've forked all your
> children.

Ok - I should be checking for a successful fork, though I have to ask:  Has
anyone ever seen a fork fail (on a *nix system)?  If so, why did it fail?
I'm genuinely curious.  I realize the books all say that it should be
checked for, but aren't the odds extremely small of this happening?

Regarding the 'wait', I already had a $SIG{CHLD} handler set up, so it
wasn't necessary.  Also, it was clear to me that if I stuck the 'wait' in
there,  the code appeared to be running sequentially, whereas when I took it
out, it was clearly running in parallel (and faster).  I could tell using
two very non-scientific methods: watching the speed of the output and
checking to see when the command prompt came back.

With the 'wait' added, it would run slower and the command prompt didn't
come back until the loop finished.  Without the 'wait', it ran faster and
the command prompt returned instantly, before the ssh commands even started.

Then again, perhaps I just had the 'wait' in the wrong place, or maybe
adding a second 'wait' when I already had a $SIG{CHLD} handler set up
screwed it up.

Regards,

Mr. Sunblade





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

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.  

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


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