open my $FILE, '<', 'file1.txt' or die "Cannot open file1.txt: $!"; #### while (my $text = <$FILE>) { chomp $text; my @cums = (0); # ... }