#!/usr/local/bin/perl #Example of chopper program in command line PERL #Does NOT use CGI print "What is the airspeed in knots?"; $knots = ; chop $knots; print "What is the distance in kilometers?"; $dist = ; chop $dist; $kph = $knots * 1.851997; $time = $dist/$kph; $hours = int($time); $minsec = ($time - $hours) * 60; $minutes = int($minsec); $seconds = ($minsec - $minutes) * 60; #print "knots: $knots\n"; #print "distance: $dist\n"; #print "kph: $kph\n"; #print "time: $time\n"; #print "minsec: $minsec\n"; print "hours: $hours\n"; print "minutes: $minutes\n"; print "seconds: $seconds\n"; #------------------------------------------------ #Sample output on command line # klingon{aharris}1: chopper.pl # What is the airspeed in knots?40 # What is the distance in kilometers?20 # hours: 0 # minutes: 16 # seconds: 11.923820610940651932 # klingon{aharris}2: