CALC fixed by jonathan camacho

for $o (<>){
   ($frst) = $o =~ /^(\d+)/;
   $o =~ s/^(\d+)//;
   $t = $frst;
   $ostr = "$frst ";
   while( ($op, $num) = $o =~ /^([^\d])(\d+)/  ){
      $o =~ s/[^\d]\d+//;
      $ostr .= "$op $num ";
      $t = eval("$t $op $num");
   }
   print("$ostr= $t\n");
}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page