sub new { my $class = $_[0]; my $buffer; if ( $ENV{'REQUEST_METHOD'} eq 'POST' ) { read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } my $cgi = CGI->new(); if ( length $buffer ) { print $cgi->header( "text/plain" ) . "Data was read from STDIN while using the POST method.\n" . "You must instantiate a new CGI::DebugVars object AFTER\n" . "instantiating a CGI object."; exit; } my $objref = { _active => 1, _border => 1, _continue => 0, _cgi => $cgi, _pretty_not_installed => 0 }; bless $objref, $class; return $objref; }