- or download this
print "Enter the first number: ";
my $a = <>;
print "Enter the second number: ";
my $b = <>;
print "The sum of $a and $b is " . ($a + $b) . "\n";
- or download this
sub addTwo {
my ($self) = @_;
...
my $b = $self->getNum("Enter second number: ");
$self->disp("The sum of $a and $b is " . ($a + $b));
}
- or download this
##### --- index.pl ----
#!/usr/bin/perl
...
}
1;