in reply to split() Problem
When you do for $_ (@foo), $_ will sequentially contain the content of each element of the array @foo. Next you do $foo[$_], in other words you index into the array with the value of the element. This is almost certainly wrong, unless you are trying to implement some sort of linked list. I think you just want to use the content of each element and that is already in $_.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|