++ed by:

32 PAUSE users
14 non-PAUSE users.

Anthony Brummett


Devel::hdb::App::Eval - Evaluate data in the debugged program's context


Registers routes for evaluating arbitrary Perl code and for inspecting variables in the debugged program.


POST /eval

Evaluate a string of Perl code in the context of the debugged process. The code is evaluated in the content of the nearest stack frame that is not part of the debugger. The request body must contain a JSON-encoded hash with these keys:

  code      => String of Perl code to evaluate
  wantarray => 0, 1 or undef; whether to evaluate the code in scalar list
               or void context

Returns 200 if successful and the result in the body. The body contents should be decoded using Data::Transform::ExplicitMetadata Returns 409 if there was an exception. The body contents should be decoded using Data::Transform::ExplicitMetadata

GET /getvar/<level>

Get a list of all the lexical variables at the given stack level. Return a JSON-encoded array containing hashes with these keys:

  name => Name of the variable, including the sigil
  href => URL to use to get the value of the variable

Returns 404 if the requested stack level does not exist.

GET /getvar/<level>/<varname>

Searches the requested stack frame for the named variable. 0 is the currently executing stack frame, 1 is the frame above that, etc. The variable must include the sigil, and may be a more complicated expression indicating a portion of a composite value. For example: $scalar A simple scalar value @array The entire array $array[1] One element of the array $hash{key1} One element of the hash @array[1,2] Array slice @hash{key1,key2} Hash slice @array[1 .. 2] Array slice with a range

Returns 200 and JSON in the body. The returned JSON is an encoded version of whatever the Perl code evaluated to, and should be decoded with Data::Transform::ExplicitMetadata.


Devel::hdb, Padwalker


Anthony Brummett <brummett@cpan.org>


Copyright 2014, Anthony Brummett. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.