in reply to Re^2: Stupid If Question
in thread Stupid If Question

Three variables were defined, one in each block. (Blocks which aren't even mutually exclusive, I might add.) A fourth variable doesn't magically become defined elsewhere as a result. I believe you want

my $var; if (...) { $var = ...; } elsif (...) { $var = ...; } else { die; }