Help for this page

Select Code to Download


  1. or download this
    # 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
    ...
        my ($p1, $p2) = @_;
        sqrt(($p1->{x} + $p2->{x})**2 - ($p1->{y} + $p2->{y})**2)
    }
    
  2. or download this
    # Return a random integer 1 .. 6 to simulate a die roll. 
    # Seed the random number generator with the current time before calcul
    +ating.
    ...
        srand(time);
        1 + int rand 6;
    }
    
  3. or download this
    # CSS file
    span.important  {color: green}  # Green stands out!
    
  4. or download this
    my $code = $cgi->param("sql_query");
    $dbh->do($code);  # This is dangerous.