Help for this page

Select Code to Download


  1. 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";
    
  2. 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));
    }
    
  3. or download this
    ##### --- index.pl ----
    #!/usr/bin/perl
    ...
    }
    
    1;