Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: article processer

by lyklev (Pilgrim)
on Oct 08, 2010 at 21:16 UTC ( #864280=note: print w/replies, xml ) Need Help??


in reply to article processer

open(E,shift @ARGV) or die($!); chomp(@e=<E>); close(E); undef $/; $t=<>; printf("%-20s : %3d\n", "Words:" ,scalar split(' ',$t)); printf("%-20s : %3d\n ", $_, scalar(@a=($t =~ m/$_/mgi))) for @e;

Good enough to do the work, bad enough to fail a test. As a homework assignment, find out how this works and then rewrite it in a decent way.

Hint: takes as arguments one file with a list of words/expressions and a list of files to be processed.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://864280]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2018-01-17 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (206 votes). Check out past polls.

    Notices?