in reply to BWTDI: Better Way To Do It?

I don't see much improvement to be made here, except maybe replace for ( my $i=1; $i <= $qty; $i++ ) by a simple for (1..$qty) as you don't use the $i in the loop.