in reply to Sending warnings from CGI::Session to browser

By the way,

sub foo { ... }

is effectively

BEGIN { *foo = sub { ... }; }

You can move the sub out of the BEGIN.