CC: | stan [...] schwertly.com |
Subject: | "arguments" parameter in forkit makes body not optional (documentation) |
This "bug" is more of a request for clarity and may be a problem with me reading too literally.
The sub referenced in "run" for forkit has the following block of text:
"Bear in mind that the routine doesn't automatically get the text of the query - you'll need to
pass it in arguments (see below) if you want to use it at all."
Reading that both "body" and "arguments" were optional, I passed my string in an anonymous
array to arguments (I'm passing a modified body string, so I figured it made more logical
sense as an argument). I was confused as to why I wasn't getting the array in my subroutine
until I checked the code. You need to shift the top of @_ before getting into arguments, or
you'll get an undef value (body) returned when you try to grab it. body is conditionally
optional, or at least needs to be handled in your sub if you plan on using arguments.
Either noting this in the documentation, or completely leaving out $args->{body} if it's
undefined would fix this bug. Like I said, I can definitely see this being either way. I hope I'm
not being a hassle.