my ($price, $tax_rate) = split(/ /, <>); $tax_rate = (0.01 * $tax_rate + 1); my $total_price = $price * ($tax_rate); if ($total_price =~ /^[0-9]+$/) { print "$total_price\n"; }else{ my $final_price = int($total_price); print "$final_price\n"; }