in reply to find the number of words that a user has chosen for an input file that a user has also chosen

#!/usr/bin/perl -l # http://perlmonks.org/?node_id=1176022 use strict; use warnings; chomp( my $filename = <STDIN> ); chomp( my $word = <STDIN> ); print "Frequency: " . grep $word eq $_, split /\W+/, do { local (@ARGV, $/) = $filename; <> };
  • Comment on Re: find the number of words that a user has chosen for an input file that a user has also chosen
  • Download Code