[26321] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8494 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 7 10:37:35 2005

Date: Thu, 6 Oct 2005 21:05:04 -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           Thu, 6 Oct 2005     Volume: 10 Number: 8494

Today's topics:
         Re: installing module manually in windows <ron@savage.net.au>
        how to randomize List::Util::shuffle() better? <nobody@dizum.com>
    Re: how to randomize List::Util::shuffle() better? <abigail@abigail.nl>
    Re: threads, XSUB allocated memory, destructors, destru <sisyphus1@nomail.afraid.org>
    Re: variable question <notvalid@email.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 7 Oct 2005 08:23:32 +1000
From:     Ron Savage <ron@savage.net.au>
Subject:  Re: installing module manually in windows
Message-Id: <200510782332.273520@ron>

On Fri, 7 Oct 2005 03:26:04 +1000, John Bokma wrote:

Hi Folks

> http://johnbokma.com/perl/make-for-windows.html

See also http://savage.net.au/Perl-modules/html/installing-a-module.html





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

Date: Fri,  7 Oct 2005 01:30:01 +0200 (CEST)
From: Nomen Nescio <nobody@dizum.com>
Subject: how to randomize List::Util::shuffle() better?
Message-Id: <d7b178281da2b949ba2fff6baecbde80@dizum.com>

I want to pick three things at random from a list, so:

use List::Util 'shuffle';

 ..

sub pick {
    my @items = shuffle(@_);
    return join(",", @items[0,1,2]);
}

but every time I call this (repeatedly within the same run) with the
 same input list, I get the same three items back out.

Is there any way to randomize shuffle more?



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

Date: 06 Oct 2005 23:47:11 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: how to randomize List::Util::shuffle() better?
Message-Id: <slrndkbdru.7lf.abigail@alexandra.abigail.nl>

Nomen Nescio (nobody@dizum.com) wrote on MMMMCDXIX September MCMXCIII in
<URL:news:d7b178281da2b949ba2fff6baecbde80@dizum.com>:
 ..  I want to pick three things at random from a list, so:
 ..  
 ..  use List::Util 'shuffle';
 ..  
 ..  ..
 ..  
 ..  sub pick {
 ..      my @items = shuffle(@_);
 ..      return join(",", @items[0,1,2]);
 ..  }
 ..  
 ..  but every time I call this (repeatedly within the same run) with the
 ..   same input list, I get the same three items back out.


Really? Do you have a *complete* program (not longer than about 20 lines)
that shows this behaviour?

 ..  Is there any way to randomize shuffle more?


No. There are things you can do to make it *less* random, like resetting
the random seed. Are you sure you aren't calling srand before each call
to pick()?


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Fri, 7 Oct 2005 14:00:00 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: threads, XSUB allocated memory, destructors, destruction
Message-Id: <4345f2f8$0$28528$afc38c87@news.optusnet.com.au>


"Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de> wrote in message
 .
 .
>
> So in essence: the XS portion of your code isn't thread-safe. In order
> to make it thread-safe, you have to take control over the cloning
> process. See 'perldoc perlmod' and search for "CLONE". For recent perls
> (>= 5.8.7) all you have to do is provide a CLONE_SKIP method for the
> package 'Experimental' (in your case).

Yep - CLONE_SKIP seems to be the missing ingredient - works for me, anyway.

I don't  understand why the problem arises only with *blessed* objects. Does
cloning not occur wrt unblessed objects ? Or is it just that problems are
avoided simply because perl doesn't (automatically) clean up unblessed
objects  ?

Cheers,
Rob




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

Date: Thu, 06 Oct 2005 22:06:12 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: variable question
Message-Id: <odh1f.9450$oO2.7592@newssvr27.news.prodigy.net>

Abigail wrote:
> M0stro (ovelozohnospam@stopspammingglasfloss.com) wrote on MMMMCDXIX
> September MCMXCIII in <URL:news:HCf1f.1314$dB4.921@newssvr12.news.prodigy.com>:
> <>  also, what is this character called - {
> <>  
> <>  it's not a bracket 
> 
> 
> Opening brace, left brace, opening curly bracket, left curly bracket,
> moustache, ...

My PDE prof used to call it 'squiggly bracket'.

--Ala


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8494
***************************************


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