[28814] in Perl-Users-Digest
Perl-Users Digest, Issue: 58 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 21 14:06:11 2007
Date: Sun, 21 Jan 2007 11:05:06 -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 Sun, 21 Jan 2007 Volume: 11 Number: 58
Today's topics:
Copy all <admin@crayos.com>
Re: Copy all <bik.mido@tiscalinet.it>
Re: Copy all <admin@crayos.com>
Re: error trapping in select <stolze@de.ibm.com>
Re: How much more money can I make using Perl over C++? <bik.mido@tiscalinet.it>
Re: need help with the tr and s/// <novafyre@hotmail.com>
Re: need help with the tr and s/// <bik.mido@tiscalinet.it>
Re: Perl hash and rehash seeds; deterministic hash orde <bik.mido@tiscalinet.it>
Re: Perl hash and rehash seeds; deterministic hash orde <blgl@stacken.kth.se>
problem GD and my package Random->Random::new <john.swilting@wanadoo.fr>
Re: problem GD and my package Random->Random::new <john.swilting@wanadoo.fr>
Re: problems cgi and sendmail <news@chaos-net.de>
Re: problems cgi and sendmail <john.swilting@wanadoo.fr>
Re: problems cgi and sendmail <news@chaos-net.de>
Re: Search pattern not terminated at (Spreadsheet::Read anno4000@radom.zrz.tu-berlin.de
Re: Search pattern not terminated at (Spreadsheet::Read <paul@probulletin.com>
Re: Search pattern not terminated at (Spreadsheet::Read <rvtol+news@isolution.nl>
Whas is the difference between forked process vs extern <cdalten@gmail.com>
Re: Whas is the difference between forked process vs ex <bik.mido@tiscalinet.it>
Re: Whas is the difference between forked process vs ex (Randal L. Schwartz)
Re: Win32 vs UNIX <bik.mido@tiscalinet.it>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 21 Jan 2007 08:53:31 -0800
From: "=?iso-8859-1?B?UulnaW5l?=" <admin@crayos.com>
Subject: Copy all
Message-Id: <1169398411.652301.187200@51g2000cwl.googlegroups.com>
Hi,
I search function for eg: Copy all directoryA to directoryB
I use File::copy but need write fil by file
Have an solution ?
Sorry for my bad English I speak French !
Regard
R=E9gine
------------------------------
Date: Sun, 21 Jan 2007 18:50:49 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Copy all
Message-Id: <ik97r2lkd6ag4ik4t26j570kg8lvhgouvn@4ax.com>
On 21 Jan 2007 08:53:31 -0800, "Régine" <admin@crayos.com> wrote:
>I search function for eg: Copy all directoryA to directoryB
>
>I use File::copy but need write fil by file
>
>Have an solution ?
Well, for a quick'n' dirty solution, just call your OS's cp/copy
utility. But if you're concerned about portability
File::Copy::Recursive (just found with a 1 sec CPAN search) seems to
be just what you need. Otherwise you may want to do it yourself with
File::Find, and File::Copy.
>Sorry for my bad English I speak French !
No problem, your English is better than that of some dudes poppin up
with "need ur help plz abt file:copy etc. etc." and the like...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 21 Jan 2007 11:00:36 -0800
From: "=?iso-8859-1?B?UulnaW5l?=" <admin@crayos.com>
Subject: Re: Copy all
Message-Id: <1169406035.790941.273890@51g2000cwl.googlegroups.com>
My OS is Windows like 2000 but why not XP or another..
Tanks for your compliment
It's so dificult to write English
King Regard
R=E9gine
------------------------------
Date: Sun, 21 Jan 2007 19:46:32 +0100
From: Knut Stolze <stolze@de.ibm.com>
Subject: Re: error trapping in select
Message-Id: <ep0ce8$mi5$2@lc03.rz.uni-jena.de>
dcruncher4@aim.com wrote:
> I have a condition in which I have to ignore an error while SELECTING.
> The error is lock timeout (Db2 error code -911).
Could you provide the complete error message? SQL0911 is for lock timeouts
and deadlocks. The reason code would tell us which of the two cases
occurs, and the counter-measures will heavily depend on that.
> When fetchrow_arrayref
> fetches the locked row, I do get -911 which I trap in my code. When I
> move on to the next row doing another fetchrow_arrayref, I get error -3
> (no statement executing). Does that mean that fetchrow_arrayref
> will stop processing at the first error and there is no way to continue
> to the next stop, ignoring it.
Given that you are also posting to a Perl NG, I assume your application is
written in Perl?
Note that PHP has the rather stupid default behavior to query DB2 using FOR
UPDATE. Specifying FOR READ ONLY explicitly often helps a lot with locking
issues. Maybe something similar applies to Perl as well?
> DB2 gurus: Is there a way to tell DB2 while SELECTING to ignore rows
> which are locked by another session.
There are settings like DB2_SKIPDELETED, DB2_SKIPINSERTED, and
DB2_EVALUNCOMMITTED. Maybe changing those (read in the manual for their
exact implications) could help as well?
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
------------------------------
Date: Sun, 21 Jan 2007 10:24:37 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How much more money can I make using Perl over C++?
Message-Id: <41c6r25a6s2rt5082i0nkd0re3f1efi6tl@4ax.com>
On Sat, 20 Jan 2007 13:20:40 -0800, sl123@netherlands.area wrote:
>I'm thinking of changing programming flavors as a career change.
>Was wondering how Perl jobs compare to the others cash wise.
I don't have the slightest idea. But you may want to consider learning
and being proficient in both. If you like Perl and you are lucky
enough to find a stable position to only work with it, then you may be
fine just sticking with it. But if you plan on being recruited for
various jobs, say short to mid term each, then competence with
multiple languages would be a plus. I don't know elsewhere, but here
in Italy I don't see big retribution differences for jobs to be done
in different languages. You're paid for the job, not for the language
you use to do it. All this judging by my limited observational
experiences relating to stuff I've done personally, and stuff some
friends of mine are doing.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 21 Jan 2007 07:53:23 -0700
From: Mark Donovan <novafyre@hotmail.com>
Subject: Re: need help with the tr and s///
Message-Id: <C1D8CC73.9792%novafyre@hotmail.com>
To whom it may concern,
Some people seem to forget the perl motto, "There is more than one way to do
it."
Rather than simply posting a solution and explaining the method as a reply
to zim, who asked the question, Dondi chose to improve my method. I replied
and said Dondi was right. I wonder what part of "you're right" Dondi does
not understand? That's is a rhetorical question; no reply is necessary.
Dondi persists in wasting his time and mine revising a method again and
again. Dondi has never posted a direct reply to zim explaining a method.
That, after all, is the purpose of the thread... to answer zim's question.
I answered zim's question. I offered a method that works; I included an
explanation that is consistent with *my* solution. I assume zim found an
answer and has left; maybe zim will ask a question if more information is
needed.
As to Dondi's optimal improvements, I offer this section of the perl
documentation from perldoc perlstyle.
o Think about reusability. Why waste brainpower on a one-shot when
you might want to do something like it again? Consider
generalizing your code. Consider writing a module or object class.
Consider making your code run cleanly with "use strict" and "use
warnings" (or -w) in effect. Consider giving away your code.
Consider changing your whole world view. Consider... oh, never
mind.
o Be consistent.
o Be nice.
There are no relevant technical issues to this newsgroup that remain to be
discussed. I have offered to discuss anything further by e-mail.
"Consider... oh, never mind. Be consistent. Be nice."
--
Regards,
Mark Donovan
------------------------------
Date: Sun, 21 Jan 2007 18:35:09 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: need help with the tr and s///
Message-Id: <la87r2pmniqb39rbdadjqdsrhbjj4m1ld6@4ax.com>
On Sun, 21 Jan 2007 07:53:23 -0700, Mark Donovan
<novafyre@hotmail.com> wrote:
>As to Dondi's optimal improvements, I offer this section of the perl
>documentation from perldoc perlstyle.
>
>o Think about reusability. Why waste brainpower on a one-shot when
> you might want to do something like it again? Consider
> generalizing your code. Consider writing a module or object class.
> Consider making your code run cleanly with "use strict" and "use
> warnings" (or -w) in effect. Consider giving away your code.
> Consider changing your whole world view. Consider... oh, never
> mind.
OTOH also consider YAGNI.
>o Be consistent.
>
>o Be nice.
OTOH I didn't feel like stumping on your ego and I'm sorry you took it
like that, your solution IMHO was 95% fine and 5% at risk of spreading
a bad programming habit. I just wanted to correct the latter, for the
benefit of the OP. It was part of the be consistent and be nice thing,
nice to him/her, which is to say he/she who needed help. But then
again sorry to see you took it as a personal attack on you. I wanted
to resist the temptation to answer further, but I did. In any case
this is my last word on the whole question. I tried to stress hard the
difference from my pov between suboptimality and useless redundancy,
but appearently to no avail. So long then...
PS: BTW there's no reason I wouldn't have wanted to be nice to you
too, and FWIW I apologize if gave that impression, but that's not the
case and it was all up to you to feel like I were bashing you or
whatever.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 21 Jan 2007 10:18:26 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Perl hash and rehash seeds; deterministic hash ordering
Message-Id: <nrb6r2dfhu1si570f585cgnpbph0ehf1qk@4ax.com>
On 20 Jan 2007 13:16:39 -0800, ozgune@gmail.com wrote:
>Any ideas if there is a better group to post this?
Well, I think that this is an appropriate to discuss this issue. But
if you get nothing out of it, then you may try elsewhere, e.g. in Perl
Monks. Since this is interesting for us all, if you find an answer,
please do report it here too.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 21 Jan 2007 17:10:29 +0100
From: Bo Lindbergh <blgl@stacken.kth.se>
Subject: Re: Perl hash and rehash seeds; deterministic hash ordering
Message-Id: <ep039n$sci$1@news.su.se>
There's a flag in each hash that controls whether the random or the
non-random hash seed is used. Hashes start out non-random and switch to
random if and when the hsplit function thinks it's a good idea. Search for
"Pathological data" in hv.c for the details.
/Bo Lindbergh
------------------------------
Date: Sun, 21 Jan 2007 17:16:48 +0100
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: problem GD and my package Random->Random::new
Message-Id: <45b391ea$0$25937$ba4acef3@news.orange.fr>
my code not work
its obvious for me
#!/usr/bin/perl -w
use strict;
use diagnostics;
use GD;
use GD::Text;
use GD::Text::Wrap;
use CGI;
use CGI::Carp;
my $q = new CGI;
# create a new
my $im = new GD::Image(100,100);
# allocate some colors
my $white = $im->colorAllocate(255,255,255);
my $black = $im->colorAllocate(0,0,0);
my $red = $im->colorAllocate(255,0,0);
my $blue = $im->colorAllocate(0,0,255);
# make the background tra $im_pngnsparent and interlaced
$im->transparent($white);
$im->interlaced('true');
# put a black frame around the picture
$im->rectangle(0,0,99,99,$black);
# draw a blue oval
$im->arc(50,50,95,75,0,360,$blue);
# and fill it with red
$im->fill(50,50,$red);
my $text = Random->Random::new();
my $wp = GD::Text::Wrap->new ( $im,
width => 100,
line_space => 4,
color => $black,
text => $text,
);
$im->rectangle ( $wp->get_bounds(50,50), $blue);
$wp->draw(50,50);
print $q->header( -type => "image/png", -expires => "-1d");
binmode STDOUT;
print STDOUT $im->png
package Random;
sub new{
my $class=shift;
my $self={};
bless $self,$class;
my@liste=('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15',
'16','17','18','19','20','21','22','23','24','25','26','27','28',
'29','30','31','32','33','34','35','36','37','38','39','40','41',
'42','43','44','45','46','47','48','49','50','51','52','53','54',
'55','56','57','58','59','60','61','62','63','64','65','66','67',
'68','69','70','71','72','73','74','75','76','77','78','79','78',
'79','80','81','82','83','84','85','86','87','88','89','90','91',
'92','93','94','95','96','97','98','99','100','101','102','103',
'104','105','106','107','108','109','110');
$self="";
my$self1="";
my$self2="";
my$self3="";
my$self4="";
$self1.=$liste[int rand@liste];
$self .= $self1;
$self2.=$liste[int rand@liste];
$self .=$self2;
$self3.=$liste[int rand@liste];
$self .=$self3;
$self4.=$liste[int rand@liste];
return $self;
}
1
------------------------------
Date: Sun, 21 Jan 2007 18:39:15 +0100
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: Re: problem GD and my package Random->Random::new
Message-Id: <45b3a53e$0$25918$ba4acef3@news.orange.fr>
john.swilting wrote:
> my code not work
> its obvious for me
>
> #!/usr/bin/perl -w
>
> use strict;
> use diagnostics;
> use GD;
> use GD::Text;
> use GD::Text::Wrap;
> use CGI;
> use CGI::Carp;
>
>
>
>
> my $q = new CGI;
>
>
> # create a new
>
> my $im = new GD::Image(100,100);
>
> # allocate some colors
> my $white = $im->colorAllocate(255,255,255);
> my $black = $im->colorAllocate(0,0,0);
> my $red = $im->colorAllocate(255,0,0);
> my $blue = $im->colorAllocate(0,0,255);
>
> # make the background tra $im_pngnsparent and interlaced
> $im->transparent($white);
> $im->interlaced('true');
>
> # put a black frame around the picture
> $im->rectangle(0,0,99,99,$black);
>
> # draw a blue oval
> $im->arc(50,50,95,75,0,360,$blue);
>
> # and fill it with red
> $im->fill(50,50,$red);
>
>
> my $text = Random->Random::new();
>
> my $wp = GD::Text::Wrap->new ( $im,
> width => 100,
> line_space => 4,
> color => $black,
> text => $text,
> );
> $im->rectangle ( $wp->get_bounds(50,50), $blue);
> $wp->draw(50,50);
>
> print $q->header( -type => "image/png", -expires => "-1d");
> binmode STDOUT;
> print STDOUT $im->png
>
>
> package Random;
>
> sub new{
> my $class=shift;
> my $self={};
> bless $self,$class;
>
>
>
my@liste=('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15',
> '16','17','18','19','20','21','22','23','24','25','26','27','28',
> '29','30','31','32','33','34','35','36','37','38','39','40','41',
> '42','43','44','45','46','47','48','49','50','51','52','53','54',
> '55','56','57','58','59','60','61','62','63','64','65','66','67',
> '68','69','70','71','72','73','74','75','76','77','78','79','78',
> '79','80','81','82','83','84','85','86','87','88','89','90','91',
> '92','93','94','95','96','97','98','99','100','101','102','103',
> '104','105','106','107','108','109','110');
> $self="";
> my$self1="";
> my$self2="";
> my$self3="";
> my$self4="";
> $self1.=$liste[int rand@liste];
> $self .= $self1;
> $self2.=$liste[int rand@liste];
> $self .=$self2;
> $self3.=$liste[int rand@liste];
> $self .=$self3;
> $self4.=$liste[int rand@liste];
> return $self;
> }
> 1
I am going to eat then to go to sleep me
I return tomorrow
my package compil nice
its $text = Random->Random::new
not works
------------------------------
Date: Sun, 21 Jan 2007 10:32:34 +0100
From: Martin =?iso-8859-1?Q?Ki=DFner?= <news@chaos-net.de>
Subject: Re: problems cgi and sendmail
Message-Id: <slrner6cpi.45e.news@maki.homeunix.net>
john.swilting wrote :
> Why the e-mail is not to send
> Why on every page he indicates to me No recipient addresses found in header
>
> my code
<code snipped>
Who is supposed to read about 300 lines of your code?
For sending Email you might want to use the Module Mail::Mailer wich is
quite simple to use.
--- example code with less then ten lines ;) ---
use Mail::Mailer;
my $mailer = Mail::Mailer->new;
$mailer->open({ To => 'your_frind@mailprovider.com',
From => 'you@yourprovider.com',
Subject => 'hello'});
print $mailer "This is the first part of the message.\n";
print $mailer "This is the second part of the message.\n";
#now send the message
$mailer->close;
--- example code ---
Best regards
Martin
--
perl -e '$S=[[73,116,114,115,31,96],[108,109,114,102,99,112],
[29,77,98,111,105,29],[100,93,95,103,97,110]];
for(0..3){for$s(0..5){print(chr($S->[$_]->[$s]+$_+1))}}'
------------------------------
Date: Sun, 21 Jan 2007 15:25:46 +0100
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: Re: problems cgi and sendmail
Message-Id: <45b377e5$0$25942$ba4acef3@news.orange.fr>
Martin Kißner wrote:
> john.swilting wrote :
>> Why the e-mail is not to send
>> Why on every page he indicates to me No recipient addresses found in
>> header
>>
>> my code
>
> <code snipped>
>
> Who is supposed to read about 300 lines of your code?
>
> For sending Email you might want to use the Module Mail::Mailer wich is
> quite simple to use.
>
> --- example code with less then ten lines ;) ---
> use Mail::Mailer;
> my $mailer = Mail::Mailer->new;
> $mailer->open({ To => 'your_frind@mailprovider.com',
> From => 'you@yourprovider.com',
> Subject => 'hello'});
> print $mailer "This is the first part of the message.\n";
> print $mailer "This is the second part of the message.\n";
> #now send the message
> $mailer->close;
> --- example code ---
>
>
> Best regards
> Martin
>
will sendmail work on localhost server
maybe or not
code snipped
compil nice
its sendmail the problem
------------------------------
Date: Sun, 21 Jan 2007 16:26:51 +0100
From: Martin =?iso-8859-1?Q?Ki=DFner?= <news@chaos-net.de>
Subject: Re: problems cgi and sendmail
Message-Id: <slrner71hr.4e5.news@maki.homeunix.net>
john.swilting wrote :
> Martin Kißner wrote:
>> --- example code with less then ten lines ;) ---
>> use Mail::Mailer;
>> my $mailer = Mail::Mailer->new;
>> $mailer->open({ To => 'your_frind@mailprovider.com',
>> From => 'you@yourprovider.com',
>> Subject => 'hello'});
>> print $mailer "This is the first part of the message.\n";
>> print $mailer "This is the second part of the message.\n";
>> #now send the message
>> $mailer->close;
>> --- example code ---
>>
>>
>> Best regards
>> Martin
>>
>
> will sendmail work on localhost server
> maybe or not
Mail::Mailer requires a working MTA (sendmail, postfix etc.)
If your mail does not get send you might want to check the logfiles (i.
e. /var/log/mail.log) to find out the reason. But this is OT in this
newsgroup. You could also try to send an email by using the mail command
(on Unix/Linux) to see if this works.
>
> code snipped
> compil nice
> its sendmail the problem
If you can not get your MTA working properly you could consider using
Net::SMTP.
Your problems could also be locatetd at the recipient's mailserver. Some
servers do not accept mail from MTAs with dynamic IP addresses. If this
is the case you should be able to find out by reading the logfiles.
HTH
Martin
--
perl -e '$S=[[73,116,114,115,31,96],[108,109,114,102,99,112],
[29,77,98,111,105,29],[100,93,95,103,97,110]];
for(0..3){for$s(0..5){print(chr($S->[$_]->[$s]+$_+1))}}'
------------------------------
Date: 21 Jan 2007 12:21:09 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Search pattern not terminated at (Spreadsheet::Read example)
Message-Id: <51h45lF1k7ak1U1@mid.dfncis.de>
Jorge <awkster@yahoo.com> wrote in comp.lang.perl.misc:
> Paul wrote:
> > The syntax is wrong. I'm not sure what // is supposed to be doing, but
> > whatever it is, it's wrong :)
>
> You are correct. Since my posting, I have tracked down that the // is
> the Perl 6 construct for defined-or, not a set of pattern delimiters as
> I had presumed. Now, I have to re-write that portion of code so it
> plays in Perl 5.8.8 or look for a patch to Perl 5.8.8.
Replace (untested)
map {$sheet->{cell}[$_][$row] // "-"} 1 .. $sheet->{maxcol};
with
map defined ? $_ : '-', map $sheet->{cell}[$_][$row], 1 .. $sheet->{maxcol}
Btw, in the original code, the first slash is parsed as a division
operator. The second one seems to introduce an unterminated regex.
Anno
------------------------------
Date: 21 Jan 2007 04:33:17 -0800
From: "Paul" <paul@probulletin.com>
Subject: Re: Search pattern not terminated at (Spreadsheet::Read example)
Message-Id: <1169382797.074873.86620@11g2000cwr.googlegroups.com>
> You are correct. Since my posting, I have tracked down that the // is
> the Perl 6 construct for defined-or, not a set of pattern delimiters as
> I had presumed.
No, defined-or is || so:
$foo ||= 'something';
------------------------------
Date: Sun, 21 Jan 2007 14:53:09 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Search pattern not terminated at (Spreadsheet::Read example)
Message-Id: <eovuvp.1dg.1@news.isolution.nl>
Paul schreef:
> [attribution repaired] Jorge:
>> You are correct. Since my posting, I have tracked down that the // is
>> the Perl 6 construct for defined-or, not a set of pattern delimiters
>> as I had presumed.
>
> No, defined-or is || so:
>
> $foo ||= 'something';
You are confusing logical-or and defined-or. And your attribution
wasn't.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 21 Jan 2007 07:15:19 -0800
From: "grocery_stocker" <cdalten@gmail.com>
Subject: Whas is the difference between forked process vs external command in this case.
Message-Id: <1169392519.506200.97860@m58g2000cwm.googlegroups.com>
Taken from Open3
" Note if you specify "-" as the command, in an analogous
fashion to "open(FOO, "-=E2=94=82")" the child process will just
be the forked Perl process rather than an external com=C2=AD
mand. This feature isn't yet supported on Win32 plat=C2=AD
forms."
Okay, what is the big deal if the this is a forked process vs an
external command? I really can't think
of situtation and/or program off the top of my head where this would
matter.
Chad
------------------------------
Date: Sun, 21 Jan 2007 18:44:29 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Whas is the difference between forked process vs external command in this case.
Message-Id: <k297r2hpajm8fdndh686jtggbg6bmluofj@4ax.com>
On 21 Jan 2007 07:15:19 -0800, "grocery_stocker" <cdalten@gmail.com>
wrote:
>" Note if you specify "-" as the command, in an analogous
> fashion to "open(FOO, "-=E2=94=82")" the child process will just
> be the forked Perl process rather than an external com=C2=AD
> mand. This feature isn't yet supported on Win32 plat=C2=AD
> forms."
>
>
>Okay, what is the big deal if the this is a forked process vs an
>external command? I really can't think
>of situtation and/or program off the top of my head where this would
>matter.
So just don't bother. Should you ever stumble into a situation in
which you want to fork() with managing STDIN, STDOUT and STDERR of the
forked process, which AIUI is what '-' is for, then you will matter.
Up until then don't mind, or if you really really want to, just find a
possibly artificial situation exhibiting the need for it! ;-)
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 21 Jan 2007 10:02:38 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: "grocery_stocker" <cdalten@gmail.com>
Subject: Re: Whas is the difference between forked process vs external command in this case.
Message-Id: <86lkjw5kch.fsf@blue.stonehenge.com>
>>>>> "grocery" == grocery stocker <cdalten@gmail.com> writes:
grocery> Okay, what is the big deal if the this is a forked process vs an
grocery> external command?
forked process: still running perl code from the same program
external command: brand new data and code
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Sun, 21 Jan 2007 10:34:00 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Win32 vs UNIX
Message-Id: <8ec6r21u06vo8tqpi61bb9fvrqqvf113dc@4ax.com>
On Sat, 20 Jan 2007 15:04:28 -0800, sl123@netherlands.area wrote:
>>> is perl code tested OK in win32 platform will 100% or 99% under UNIX?
>>>
>>> how likely there is compatibility happens?
>>
>>That's entirely up to you. If you've used Windows-specific APIs like COM,
>Can you explain this. Are you saying windows modules? Or do you mean referenced from
>Perl code.. COM api's? Can I reference from Perl Unix api's, or are you joking?
He meant what he wrote and I don't see how he could not be serious.
Indeed he's talking about many different things. Actually if you use
Win32::* modules, then you can't hope your code to run as smooth under
*NIX, that is, unless you took care to check the OS and conditionally
load those modules at run time. Of course, similarly, you would be in
trouble if you used system() (or backticks or piped open()) with a
windows specific programm, or, like he wrote in the previous post, if
you assumed windows-like paths to start with, and hardcoded them.
re COM api's, see
http://en.wikipedia.org/wiki/Component_Object_Model
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
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 58
*************************************