package CapSrand; sub new { bless { LOG => [], LEN => 10 }; } sub capsrand { my $self = shift; -* $self -> { PARM } = shift; $self -> capture; srand( $self -> { PARM } ); } sub capture { # note: LIFO queue my $self = shift; unshift @{ $self -> { LOG } }, $self -> { PARM }; $#{ $self -> { LOG } } >= $self -> { LEN } and $#{ $self -> { LOG } } = $self -> { LEN } - 1; } sub latest { my $self = shift; $self -> { LOG }[ 0 ] or undef(); } 1;