No such thing as a small change | |
PerlMonks |
Re: print failing to output anythingby Zed_Lopez (Chaplain) |
on Nov 12, 2003 at 20:04 UTC ( [id://306615]=note: print w/replies, xml ) | Need Help?? |
The problem isn't with print, it's with the rest of your code. The empty while loop near the top does nothing. Consider using the \b word boundary assertion to do your splitting (or just use split.) If you want to iterate over a list of words with m/.../g, use a while loop. Your foreach loops are assigning a list to a scalar ($word), thus the scalar's value during every iteration of the loop is that of the last element of the list (the last word on the line). Almost certainly not what you want.
In Section
Seekers of Perl Wisdom
|
|