Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > b7558c49ef4aee74752db064035d9740 > files > 19

perl-Continuity-1.500.0-10.mga5.i586.rpm

#!/usr/bin/perl

use strict;
use lib '../lib';
use Continuity;

Continuity->new->loop;

sub main {
  my $request = shift;

  $request->print(qq{
    <form>
      Enter first number:
      <input type=text name=num><input type=submit>
    </form>
  });
  $request->next;
  my $num1 = $request->param('num');

  $request->print(qq{
    <form>
      Enter second number:
      <input type=text name=num><input type=submit>
    </form>
  });
  my $num2 = $request->next->param('num');

  my $sum = $num1 + $num2;
  $request->print(qq{
    <h2>The sum of $num1 and $num2 is $sum!</h2>
  });
}