NAME
Langertha::Raider::Result - Result object for Raider and Raid execution
VERSION
version 0.503
SYNOPSIS
my $r = Langertha::Raider::Result->final('done');
if ($r->is_question) {
...
}
say "$r"; # stringifies to text (or empty string)
DESCRIPTION
Unified result type returned by Langertha::Raider and the Langertha::Raid orchestration nodes. Represents one of five high-level outcomes:
final- successful completionquestion- needs user inputpause- intentionally paused / resumableabort- explicit stop / errorcancelled- stopped from outside ("cancel" in Langertha::Raider)
Boolean context — a Result is always true
Langertha::Raider::Result overloads bool to a constant true: the object exists, so it is true, whatever "text" happens to hold. With only the "" overload and fallback => 1, Perl derives boolean context from stringification, and a question, pause or abort carries its message in "content" rather than "text" — so every result that actually needs handling was false, and a caller writing
my $r = $raider->raid(@messages);
if ($r) { ... } # entered now; silently skipped before
dropped exactly those. The same applied to a final whose text is "0". Decided in karr #100, together with the identical fix on "Boolean context — a Response is always true" in Langertha::Response.
Type is still asked with the predicates ("is_final", "is_question", "is_pause", "is_abort"), and emptiness of the text with length "$r" or has_text. The "" overload is unchanged: "$r" is still "text" (or the empty string), and eq / ne / concatenation keep routing through it.
type
Result type: final, question, pause, abort or cancelled.
text
Final output text, usually used with type => final.
content
Auxiliary text payload for non-final outcomes (question/pause/abort/cancelled).
options
Optional choices for question-style results.
data
Optional structured payload for callers/orchestrators.
context
Optional run context attached to the result.
is_final
Returns true for type => final.
is_question
Returns true for type => question.
is_pause
Returns true for type => pause.
is_abort
Returns true for type => abort.
is_cancelled
Returns true for type => cancelled.
as_hash
Returns a plain hashref representation (without context).
with_context
my $with_ctx = $result->with_context($ctx);
Returns a cloned result object with context attached.
final
my $r = Langertha::Raider::Result->final('ok');
Constructor helper for final results.
question
my $r = Langertha::Raider::Result->question('Which option?', options => ['a','b']);
Constructor helper for question results.
pause
my $r = Langertha::Raider::Result->pause('Waiting for external event');
Constructor helper for pause results.
abort
my $r = Langertha::Raider::Result->abort('Cannot continue');
Constructor helper for abort results.
cancelled
my $r = Langertha::Raider::Result->cancelled('Cancelled');
Constructor helper for cancelled results.
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha-raider/issues.
IRC
Join #langertha on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.