4 # Purpose: to sum the integers in the file sumit.dat
5 # Author: pc2@ecs.csus.edu or http://www.ecs.csus.edu/pc2
7 # Sat Oct 30 13:20:59 PDT 1999
9 # caveat - this is not nice code, copy at own risk ;)
11 # $Id: sumit.pl,v 1.1 2005/03/06 05:13:57 laned Exp $
15 open (FP
, "sumit.dat") || die "Could not open file sumit.dat\n";
23 $sum += $num if $num > 0;
26 print "Sum of positive integers is $sum\n";