#!/usr/bin/perl

#test2.pl 
#the one shown in the class is snip of this code.
#use strict;

open( USERNAMES, "<test2txt") || die "can't open test2txt $! \n" ;
while( $sometext = <USERNAMES> ){
	$name = getnextemail($sometext);
	#What does this do?
	if ($emailcount{$name})  {
		$emailcount{$name}++;
		print $name. ":". $emailcount{$name}. "\n";
	}else{
		$emailcount{$name} = 1;
		print $name. ":". $emailcount{$name}. "\n";
	}
}
close(USERNAMES);

sub getnextemail {
	my $line = @_[0];
	chomp($line);
	return $line;
}
