$lc1 = wc -l my_file.txt; $lc2 = sort my_file.txt | uniq | wc -l; if( $lc1 != $lc2 ) { #test fails } else { #test good! } #### >perl -e"@x=qw/foo bar/; print scalar keys map { $_ => 1 } @x;" #### Type of arg 1 to keys must be hash (not map iterator) at -e line 1, near "@x;" Execution of -e aborted due to compilation errors.