NAME

Web::Detect - Detect if program is running under some web environment

VERSION

version 0.02

SYNOPSIS

use Web::Detect qw(detect_web);
say "Running under web" if detect_web();

DESCRIPTION

FUNCTIONS

detect_web() => HASHREF

Return undef if not detected running under any web environment.

Return a hash otherwise, with following keys: mod_perl (bool, true if detected running under mod_perl), plack (bool, true if detected running under Plack), cgi (bool, true if detected running under CGI).

FAQ

What is the use of this module?

Usually I do it to decide whether to output HTML or plaintext. Running under some web environment usually prefers HTML output.

TODO

SEE ALSO

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.