use strict; use warnings; sub memory { qx( tasklist /nh /fi "PID eq $$" ) =~ m[(\S+ K)$] } use Time::HiRes 'time'; my $t = time; my ( @a, %h ); open my $fh, '<:raw', 'unixdict.txt' or die; while ( <$fh> ) { next unless length > 6; chomp; ( -1 != index $_, 'e' ) ? ( push @a, $_ ) : ( -1 != index $_, 'i' ) ? ( $h{ $_ } = 1 ) : 1 } close $fh; my ( $s, $i ) = ''; exists $h{ $i = tr/e/i/r } and $s .= sprintf "%30s %s\n", $_, $i for @a; print time - $t, "\n"; print memory, "\n"; print $s;