# Calculate the length of a segment by taking the square root of the # differences of the squares of the sum of the x and y coordinates sub segment_length { my ($p1, $p2) = @_; sqrt(($p1->{x} + $p2->{x})**2 - ($p1->{y} + $p2->{y})**2) } #### # Return a random integer 1 .. 6 to simulate a die roll. # Seed the random number generator with the current time before calculating. sub roll { srand(time); 1 + int rand 6; } #### # CSS file span.important {color: green} # Green stands out! #### my $code = $cgi->param("sql_query"); $dbh->do($code); # This is dangerous.