You can confine the no warnings 'uninitialised'; to the lexical scope but you can make it even tighter if you wish by confining it to the print with the use of a do block.
for (my $ii=0; $ii < scalar(@some_array); $ii++) { print do { no warnings 'uninitialized'; # for the do block only "Value at position $ii: $some_array[$ii]\n"; }; }
I hope this is of interest.
Cheers,
JohnGG
In reply to Re^2: Annoying 'Use of uninitialized value in concatenation' warning
by johngg
in thread Annoying 'Use of uninitialized value in concatenation' warning
by alain_desilets
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |