why dont you try something like below if (! defined $WCkey) cheers srikrishnan