in reply to Re^4: to copy certain content in file & repeat it .
in thread to copy certain content in file & repeat it .
Congratulations, you're getting closer :)
Your if logic is clear now, and correct, you're almost finished
But, your code once again does not compile, and has not been tidied, and you're still not push-ing onto the array
You attempt to compensate by using an index, but you're using it on the wrong variable
There is no @lin array, and @arr does not exist outside of the if block, where you assign to it, instead of pushing
You need to increase the scope of @arr, by declaring it outside the while loop, the same as you did $fg
You need to push $lin onto @arr
Unsure of what i'm talking about? You should read the basic datatypes, three, Arrays: A Tutorial/Reference, Lexical scoping like a fox
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: to copy certain content in file & repeat it .
by harshmane (Initiate) on Jul 01, 2011 at 10:55 UTC | |
by Anonymous Monk on Jul 01, 2011 at 11:20 UTC |