# Test to see if we got the expected input if($amount =~ m/^-?(\d+)\.(\d\d)$/) { my $integerpart = $1; my $decimalpart = $2; # Display template for correct input here } else { # Display template for error here }