Then spend some time analyzing it, understanding the code you want to use is very important. If you won't get it (actually even if you will) - use module, as advised here: Re: How to create loop in perl dynamically
Comment on Re^3: How to create loop in perl dynamically