in reply to variable like $_

Usage of a temporary variable gives more clarity to your code and solves your problem, this $_ is a global variable it gets changed depending on the loop/block/function that you are currently in. I think that using the outer loop's $_ in the inner loop without a temporary variable isn't possible and it is not good; it would lead to confusion for the reader/maintainer or even you when you look back.

Vivek
-- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.