Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: print failing to output anything

by Zed_Lopez (Chaplain)
on Nov 12, 2003 at 20:04 UTC ( [id://306615]=note: print w/replies, xml ) Need Help??


in reply to print failing to output anything

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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found