
Games::Sudoku::Component::Result

use Games::Sudoku::Component::Result;
# verbose
my $verbose = 1;
sub some_function {
my $return_code = 1;
if ($verbose) {
return Games::Sudoku::Component::Result->new(
result => $code,
reason => 'more descriptive error message',
);
}
else {
return $code;
}
}
# Then, check the result.
if (my $result = &some_function) {
print ref $result ? $result->{reason} : 'something has happened';
}

This module is mainly for debugging. Use this for a normal scalar return code, and you can get more detailed or additional information about it.

Options are:
If there is only one argument, it is supposed to be a result code.
Returns the values stored when the object was created, respectively.

Kenichi Ishigaki, <ishigaki@cpan.org>

Copyright (C) 2006 by Kenichi Ishigaki
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.