Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Timbo (4486)

  (email not shown publicly)

Journal of Timbo (4486)

Saturday August 16, 2003
02:23 AM

Better Carpentry through Perl

[ #14154 ]
I am building a deck that, should global warming completely cover Anchorage with water, will serve as the first wooden aircraft carrier.

Anyway, I had an interesting (and uncommon, at least for programmers) problem -- I needed a way to determine if a support beam was perfectly square to my house. Sure, I could use the old 3-4-5 rule (Pythagorean theorem; triangle with one leg 3, other 4, and hypotenuse 5 is a right triangle)(as if I had to explain that in this forum), but I wanted to use the full length of the beam for the shortest leg to minimize the margin for error.

So, I whipped up a perl script. Maybe I was just looking for an excuse. I used Number::Fraction to accept a rational number, and the script would output the length of the longer leg and hypotenuse, in rational number accuracy up to 128ths. All I had to do was mark the proper distance from where the beam met the house, and move the end of the beam around until the hypotenuse length was right.

When your favorite tool is a perl script...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.