#!/usr/local/bin/perl use strict; use warnings; my($title,$num1, $num2, $result); format report_TOP= @||||||||||||||@>>>>>>>> $title , "Page $%" --------------------------------- NUMBER1 || NUMBER2 || ADDITION --------------------------------- . format report= @###@#########@############ $num1, $num2, $result . $~="report"; $^="report_TOP"; $title = "Some Report"; START: print "Please Enter a text containing pairs of numbers\n"; while(<>){ if(/^(exit|quit)$/){exit;} ($num1, $num2) = (/(\d+)/g) for ($_); add($num1, $num2); } sub add{ # open FILE,'>REPORT.txt' or die "could not open it $!\n"; # select FILE; for(my $index=0;$index<100;$index++){ $result = $num1 + $num2; write; $num1++; $num2++; } print "another Pair of numbers? Y N\n"; if(<> =~ /^N$/i){ exit; }else{ print "Please Enter a text containing pairs of numbers\n"; "START"; } }