Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://864280]
NodeReaper cleans and fillets

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2018-07-21 10:01 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (446 votes). Check out past polls.