print join(',', @{ $uword{ $seen{ $key }[ 1 ] }[ 1 .. $#{ @uword{ $seen( $key ) } } ] } );
####
Global symbol "$seen" requires explicit package name at ./namevsfield.pl line 105.
syntax error at ./namevsfield.pl line 105, near "$seen( "
syntax error at ./namevsfield.pl line 107, near "}"
Execution of ./namevsfield.pl aborted due to compilation errors.
####
foreach my $string ( @word ) {
if ( $uword{ $string }[ 0 ] == 1 ) {
push @{ $uword{ $string } }, $line;
next;
}
$uword{ $string }[ 0 ] = 1;
push @{ $uword{ $string } }, $line;
}
####
foreach my $string ( @data ) { # dedupe data and sanity check.
next if !defined ($string); # should never be true.
next if $seen{ $string }[ 0 ] == 1; # check %seen hash / array for dupe
$seen{ $string }[ 0 ] = 1; # define hash of array and assign check to it.
$seen{ $string }[ 1 ] = $key; # add word from line to hash for reference.
}