in reply to Testing for empty string
if (length($rc=$ref->getc)) { ... }
But if that's the standard getc() then you probably want defined() instead.
-- Chip Salzenberg, Free-Floating Agent of Chaos