1 print "Enter a temperature in Celsius:\n"; 2 $celsius = <STDIN>; # read a line of input 3 chomp( $celsius ); # remove newline 4 5 if ( $celsius =~ m/^[0-9]+$/ ) { 6 $fahrenheit = ( $celsius * 9/5 ) + 32; 7 print "$celsius C = $fahrenheit F\n"; 8 } else { 9 print "Expecting a number, not \"$celsius\"\n"; 10 }