in reply to Stumped by error message

Are you by any chance running this with mod_perl ? mod_perl generate very strange side-effects with code and variables that appear to be in the main package.