my $cgi; if (exists $ENV{HTTP_ACCEPT_ENCODING} and $ENV{HTTP_ACCEPT_ENCODING} =~ /gzip/i and eval { require CGI::Compress::Gzip; 1 } ) { $cgi = CGI::Compress::Gzip->new(); } # if else { # if not, just send plain text $cgi = CGI->new(); } # else