NAME

Devel::Chitin::Exception - A class to represent a subroutine call return

SYNOPSIS

my $exp = Devel::Chitin::SubroutineReturn->new(
              package     => 'main',
              subroutine  => 'main::foo,
              filename    => '/usr/local/bin/program.pl',
              line        => 10,
              wantarray   => 0,
              rv          => 'It worked!');
printf("On line %d of %s, subroutine %s returned: %s\n",
      $exp->line,
      $exp->filename,
      $exp->subroutine,
      $exp->rv);

DESCRIPTION

This class is used to represent the occurance of a subroutine returning to its caller. It is a subclass of Devel::Chitin::Location. They are primarily used in the optional callback triggered from stepout().

METHODS

Devel::Chitin::SubroutineReturn->new(%params)

Construct a new instance. The following parameters are accepted. The values should be self-explanatory. All parameters except callsite are required.

package
filename
line
subroutine
callsite
rv

Each construction parameter also has a read-only method to retrieve the value.

The rv() method is special - it can be changed by passing a new value as the method argument. When this behavior is used as part of a callback from a stepout(), the actual return value from the function can be changed in the running program.

SEE ALSO

Devel::Chitin::Location, Devel::Chitin

AUTHOR

Anthony Brummett <brummett@cpan.org>

COPYRIGHT

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