Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Word Frequency counter

by toolic (Bishop)
on Oct 02, 2008 at 20:23 UTC ( [id://715088]=note: print w/replies, xml ) Need Help??


in reply to Word Frequency counter

Probably unrelated to your problem, but your outer while loop will be infinite if your @thisfile array has any contents. It would be better to use a for loop instead:
for (@thisfile) {

Replies are listed 'Best First'.
Re^2: Word Frequency counter
by DrWhy (Chaplain) on Oct 02, 2008 at 20:32 UTC
    Actually, this is related. Anonymous' regex is trying to match against $_, but while loops (and everything else in this code) don't set $_, so it's undefined. If you change the outer while to a for then you have something that sets $_.

    Update: Complete gibberish fixed. Now it says what I meant to say

    --DrWhy

    "If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://715088]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2025-04-19 05:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.