in reply to How to make a perl file add random numbers that a user enters?
And so on.#!/usr/bin/perl use strict; use warnings; print "What would you like to do? <add|subtract|multiply|divide>: "; chomp(my $todo = <STDIN>); if($todo eq "add") { print "$first_num + $second_num = ", $first_num + $second_num, "\n +"; } elsif($todo eq "subtract") { print "$first_num - $second_num = ", $first_num - $second_num, "\n +"; } ...
|
|---|