in reply to Declare Variable in Loop

Putting their declaration in the loop body limits their scope to the loop pass.

Maybe you should tell us what you want to do rather than telling us how you want to do it. My only guess is that you want

{ my ($variable1, $variable2); my @return_details; while (my $test = <TESTFILE>) { ... } }

Replies are listed 'Best First'.
Re^2: Declare Variable in Loop
by drodinthe559 (Monk) on Mar 26, 2010 at 22:27 UTC
    I'm trying to remove them as variable since they are only temporary.
      I presume that means that you don't want them accessible by code further down. The solution I presented solves exactly that problem.
        Thank you, I thought so. Would you just call that a block?