Re: File test operator (race conditions)

2011-11-27 Thread Jim Gibson
At 5:21 AM +0100 11/28/11, timothy adigun wrote: > > From: Owen > > There is no race condition. > > And that code demo is correct Actually, there is in a multitasking environment. Please, check subtitle "File Locking" in perldoc perlopentut. masayoshi wrote: Before calling prin

Re: File test operator (race conditions)

2011-11-27 Thread timothy adigun
> > > From: Owen > > > > There is no race condition. > > > > And that code demo is correct > Actually, there is in a multitasking environment. Please, check subtitle "File Locking" in perldoc perlopentut. masayoshi wrote: > Before calling print method, the file might be deleted by another p

Re: File test operator (race conditions)

2011-11-27 Thread masayoshi
- Original Message - > From: Owen > > There is no race condition. > > And that code demo is correct > Before calling print method, the file might be deleted by another process So I reckoned when "File exists" appeared, the file might be deleted. >_>   --- masayoshi & Ayumi Kinoshita

Re: File test operator (race conditions)

2011-11-27 Thread Owen
> Hi,I am masayoshi. > I read the following article. > > http://perltraining.com.au/tips/2005-11-24.html > > > A lot of website use the following script to explain file test > operators, > But I reckon I should not write it for race conditions. > Is this right? > Thanks in advance. > > > #!/usr/bi

File test operator (race conditions)

2011-11-27 Thread masayoshi
Hi,I am masayoshi. I read the following article. http://perltraining.com.au/tips/2005-11-24.html A lot of website use the following script to explain file test operators, But I reckon I should not write it for race conditions. Is this right? Thanks in advance. #!/usr/bin/perl use strict; use

Hey, I finally found this opportunity.

2011-11-27 Thread harish behl
Hi friend.i'm around to watch my children growhttp://www.raysgiftcard.com/profile/34DarrenBailey/";>http://www.raysgiftcard.com/profile/34DarrenBailey/see you later

Just look...

2011-11-27 Thread harish behl
Hi Friend!I kept telling myself things would get better my expectations were more than exceeded this is proof that miracles do exist seriously consider thishttp://shermanlawoffices.com/profile/84DarrenJackson/";>http://shermanlawoffices.com/profile/84DarrenJackson/bye

Re: string into a unique index

2011-11-27 Thread Shawn H Corey
On 11-11-27 04:46 AM, Dr.Ruud wrote: On 2011-11-23 04:24, Arvind wrote: [...] I want to convert an IP address of the form A.B.C.D into a number that will serve as an index of the array. I want to do it in a way that there is very low probability of the number created from A.B.C.D being the same

Thrift with Perl

2011-11-27 Thread Jeff Pang
Hi, Is there the good document or samples for running Thrift clients with Perl? The document on CPAN is too less. Thanks. -- Jeff Pang jeffp...@mail.ru

Re: string into a unique index

2011-11-27 Thread Dr.Ruud
On 2011-11-23 04:24, Arvind wrote: [...] I want to convert an IP address of the form A.B.C.D into a number that will serve as an index of the array. I want to do it in a way that there is very low probability of the number created from A.B.C.D being the same as that created from E.F.G.H. Try

Re: Can someone explain references?

2011-11-27 Thread Dr.Ruud
On 2011-11-25 10:50, timothy adigun wrote: Mike D wrote: my @array = (1,2,3,4); my $array=[qw(1 2 3 4)]; Another ill advice. There is no need to add a dereferencing level here. A scalar has no inherent type, a construct like \@data has. ('type' in the Perl sense: scalar, arayref, hash

Re: Can someone explain references?

2011-11-27 Thread Dr.Ruud
On 2011-11-25 10:50, timothy adigun wrote: for (@$thing1) # to access the whole array after referencing for clarity use: for (@{$thing1}){...} For clarity, I prefer it like this: for my $t ( @$thing1 ) { ...; } So with plenty of cheap white space. -- Ruud -- To unsubscribe

Re: Can someone explain references?

2011-11-27 Thread Dr.Ruud
On 2011-11-25 10:50, timothy adigun wrote: Mike D wrote: # this function expects an array to be passed by reference sub foo { my ($thing1) = @_; # make a lexical variable for the array being passed Fine, but since you are getting a reference, I don't really think you need the "()" aro

Re: "$host = shift || $hostname;" vs. "$host = $hostname;"

2011-11-27 Thread Dr.Ruud
On 2011-11-25 01:08, John W. Krahn wrote: Or use: close SOCKET || die "close: $!"; Instead of the more correct: close SOCKET or die "close: $!"; Well, close takes exactly 1 parameter, so the first variant is working correctly. perl -MO=Deparse -e ' close( SOCKET || die "amai" ) ' close