The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CGI::Inspect - Inspect and debug CGI apps with an in-browser UI

SYNOPSIS

  use CGI;
  use CGI::Inspect;

  print "Content-type: text/html\n\n";
  for my $i (1..10) {
    print "$i cookies for me to eat...<br>";
    inspect() if $i == 5;
  }

DESCRIPTION

This class is a drop-in web based inspector for plain CGI (or CGI-based) applications. Include the library, and then call inspect(). In your server error logs you'll see something like "Please connect to localhost:8080". When you do, you'll be greeted with an inspection UI which includes a stack trace, REPL, and other goodies.

REQUIREMENTS

To work it's magic this modules needs Continuity, Padwalker, and Data::Alias. Some plugins have additional dependencies which are not pulled in when installing from CPAN.

EXPORTED SUBS

inspect()

This starts the Continuity server and inspector on the configured port (defaulting to 8080).

METHODS

These methods are all internal. All you have to do is call inspect().

CGI::Inspect->new()

Create a new monitor object.

$self->start_inspecting

Load plugins and start inspecting!

$self->start_server

Initialize the Continuity server, and begin the run loop.

$self->display

Display the current page, based on $self->{content}

$self->request

Returns the current request obj

$self->load_plugins

Load all of our plugins.

$self->main

This is executed as the entrypoint for inspector sessions.

SEE ALSO

Carp::REPL

AUTHOR

  Brock Wilcox <awwaiid@thelackthereof.org> - http://thelackthereof.org/

COPYRIGHT

  Copyright (c) 2008-2009 Brock Wilcox <awwaiid@thelackthereof.org>. All rights
  reserved.  This program is free software; you can redistribute it and/or
  modify it under the same terms as Perl itself.