Devel::Chitin::Exception - A class to represent a subroutine call return
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);
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().
stepout()
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.
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.
rv()
Devel::Chitin::Location, Devel::Chitin
Anthony Brummett <brummett@cpan.org>
Copyright 2021, Anthony Brummett. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
To install Devel::Chitin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Chitin
CPAN shell
perl -MCPAN -e shell install Devel::Chitin
For more information on module installation, please visit the detailed CPAN module installation guide.