in reply to Re^3: Perl command line interpreter not working
in thread Perl command line interpreter not working
Oh, and you could simplisticly provide a replacement by:
use strict; use warnings; use Math::Random::MT qw(); package Range; sub new { my ($class, %params) = @_; return bless \%params, $class; } sub rrand { my ($self) = @_; my $num = Math::Random::MT::rand ($self->{HI} - $self->{LO}) + $se +lf->{LO}; $num = int $num if $self->{TYPE} eq 'INTEGER'; return $num; } package main; my $rng = Range->new ( LO => 10000, HI => 99999, TYPE => 'INTEGER' ); my $A = $rng->rrand (); my $B = $rng->rrand (); my $str = "$A $B"; print "perl version $]\n"; print "Math::Random::MT version: $Math::Random::MT::VERSION\n"; print $str;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Perl command line interpreter not working
by baperl (Sexton) on Oct 15, 2011 at 02:41 UTC | |
by BrowserUk (Patriarch) on Oct 15, 2011 at 03:07 UTC | |
by baperl (Sexton) on Oct 15, 2011 at 03:14 UTC | |
by GrandFather (Saint) on Oct 15, 2011 at 03:32 UTC | |
by baperl (Sexton) on Oct 15, 2011 at 15:09 UTC | |
|