randomRange(하한값, 상한값)
my $item_min_num = '10';
my $item_max_num = '50';
randomRange($item_min_num, $item_max_num);
sub randomRange {
my $num1 = shift;
my $num2 = shift;
return int( (rand() * ($num2 - $num1 + 1)) + $num1 );
}
my $item_max_num = '50';
randomRange($item_min_num, $item_max_num);
sub randomRange {
my $num1 = shift;
my $num2 = shift;
return int( (rand() * ($num2 - $num1 + 1)) + $num1 );
}
'Development > Perl' 카테고리의 다른 글
strawberry perl에 DBD::mysql CPAN모듈 설치 (0) | 2009.01.15 |
---|
댓글