s/xyz456/$genpass[0]/;
means
$_ =~ s/xyz456/$genpass[0]/;
You checked whether $genpass[0] was undef or not, but you didn't check $_.
In reply to Re: Why do I get uninitialized value in substitution (s///) in my array?
by ikegami
in thread Why do I get uninitialized value in substitution (s///) in my array?
by xjlittle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |