in reply to Use of local :causes use of uninitialized variable warning/error
I'm just wondering why you didn't get Can't localize lexical variable %s instead? But it looks like that is because you have more than one %opts variable in your program.
Anyway, local only works on package variables and hides the value(s) of that variable in the current scope.
You should probably have a look at Coping with Scoping for more details.
Update: Also put these two lines at the beginning of your program:
use warnings; use strict;
|
|---|