#!/usr/bin/perl -w use strict; my($input,$hrate,$yrate,$x); while(!defined $x){ print "Do you wish to calculate yearly salary (y) or hourly rate (h):"; chomp($input=); if($input=~/y/i){ # I am just guessing that this is what you're # trying to do print "Enter your yearly salary: "; chomp ($yrate=); $hrate=($yrate/52)/40; printf("You make \$%2d per hour.",$hrate); $x=1; }elsif($input=~/h/i){ print "Enter your hourly rate: "; chomp ($hrate=); $yrate=($hrate * 40)*52; print"\nYour yearly salary is \$$yrate\n"; $x=1; }else{ print"Please enter either h or y.\n\n"; sleep 2; ) }