in reply to reduce line of code

Yes, you can replace it with the empty statement. All you are doing in each block is setting a variable which is lexical to the block - and will hence be gone on block exit.

Effectively, the above statement does nothing at all (unless there's some magic attached to $step_no).