#!/usr/bin/perl $rand_value_int = int( rand(6) ) + 1; $rand_value = rand(6) + 1; print "Content-type:text/html\n\n"; printf( "rand_value_int = $rand_value_int" ); print "<br>"; printf( "rand_value = $rand_value" ); ●出力結果 rand_value_int = 2 rand_value = 5.8487420138743