#!/usr/bin/perl use CGI ':standard'; use CGI::Carp qw(fatalsToBrowser); use strict; use warnings; $prez=param('prez'); $vice=param('vice'); $secretary=param('secretary'); $count = 1; my %votes; my $file = 'vote.txt'; open my $ih, $file or die $! while (<$ih>) { chomp; my ($user, $count) = split ','; $votes{$user} = $count; } close $ih; $votes{sam}++; open my $oh, $file or die $! for my $user (keys %votes) { print $oh "$user,$votes{$user}\n"; } close $oh; print "main page";