Thanks a lot. I was not really clear about all the details, but I don't know what instance I can expect. So, things like $var->isa("Some::Package") don't work (in this particular case).
In this case Scalar::Util::blessed seems to me like a good perl solution :)