#!/usr/bin/perl use warnings; use strict; use diagnostics; print "Enter your First Number:\n"; my $first = <>; $first =~ s/^\s*//; #no leading spaces $first =~ s/\s*$//; #no trailing spaces (also "zapps" \n) print "Enter your Second Number:\n"; my $second = <>; $second =~ s/^\s*//; $second =~ s/\s*$//; ($first,$second) = ($second,$first) if $second < $first; print "The Biggest number is $second and the smallest number is $first\n";