my($Records); foreach $Records(@EventList) { if($Records =~ /(.*)(\,)(.*)/) { if($Records ne $eventChoice){ print "\n"; } } } &PopulateEventDropDown(@EventList,$eventChoice); sub PopulateEventDropDown { my($Records); my $eventChoice = shift; my @Records = @_; foreach $Records(@Records) { if($Records =~ /(.*)(\,)(.*)/) { if($Records ne $eventChoice) { print "\n"; } } } #end foreach }