in reply to Syntax error - "my" within foreach loop
And just in case your next question is something on the order of "Why doesn't this DWIM?, consider that you've provided no mechanism for your script to know what marks the end of your input.
chomp(my @words = <STDIN>);
...has no control mechanism to terminate the input and thus, as it stands, it runs out of control on the CLI or under debug.
As this smells like more homework (label it as such, if so), the solution of that (very basic) bit of logic is left to the student.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Syntax error - "my" within foreach loop
by FunkyMonk (Bishop) on Apr 13, 2008 at 22:43 UTC | |
by ww (Archbishop) on Apr 14, 2008 at 00:30 UTC |