I have a piece of code which does not work as I expect it to work. MAinly the defined function does not work.
@jobs = qw[job1 undef job2];
if(defined($jobs[1])) {
print "Job 1 is defined";
}
I get the output
Job 1 is defined
clearly $jobs[1]
is undef
. What am I missing?