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>) { ... } }
In reply to Re: Declare Variable in Loop
by ikegami
in thread Declare Variable in Loop
by drodinthe559
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |