Assuming you don't want to print the key when it's undefined either, you could do:
print "\n$key\n" if $key;
In reply to Re: If condition logic yielding partially correct output
by JavaFan
in thread If condition logic yielding partially correct output
by perlpal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |