in reply to Why undefined?

if(undef($nomSQL)) { $nomSQL = "";} is probably not what you want. You are undefining $nomSQL, rather than testing for definedness. You probably want this:

if( not defined $nomSQL ) { $nomSQL = ''; }

...also written as:

unless( defined $nomSQL ) { $nomSQL = ''; }

...but the latter reads less clearly to me.


Dave