in reply to Distinct field name output attempt

what have you tried so far?
to get you going, i think i'd probably start with a:
my $last_field = "";
at the top of the script somewhere. then test if $last_field eq $field, then don't print $field again, just print the value. you're gonna have to set $last_field = $field somewhere in there too.