I have a sub with some firmly variables and variables I declare and use within the sub, but when I call this sub I can't declare them.
for example:
sub func{
my ($firm1, $firm2, $possible) = @_;
...
if($possible eq "smth"){ # in case i passed this scalar
}
elsif($possible eq ("smth else" or undef/i_don_t_know)){ # in case i didn't passed this var, but i need it as at least undef or smth like that
}
func(bla, bla, bla); # ok
func(bla, bla); # not ok
When I tried that, I got an error
"Use of uninitialized value $possible in string eq at test.pl line ..."
How can I correct this?