What are you buying with Quantum:: that I don't get with my plain $distribution->[ rand @$distribution ]? Outside of having a really bloated module?
package Quaint; use strict; use Tie::Scalar; use Carp; use UNIVERSAL 'isa'; sub TIESCALAR { my ( $pck, @distribution ) = @_; croak "No distribution given." unless @distribution; bless { data => \ @distribution, state => $state }, $pck; } sub FETCH { my $self = shift; my $distribution = $self->{distribution}; $distribution->[ rand @$distribution ]; } sub STORE { my ( $self, $distref ) = @_; croak "No distribution given." unless isa($distref, "ARRAY"); my $orig_dist = $self->{'distribution'}; push @$orig_dist, @$distref; }
In reply to Re: Tied and Entangled, Quantum fun.
by diotalevi
in thread Tied and Entangled, Quantum fun.
by pernod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |