* spam@mm.st via RT (bug-MIME-Types@rt.cpan.org) [170202 14:19]:
Show quoted text
The JSON "null" is Perl's "undef"
"Void" is a term we use in the context of execution context.
Show quoted text> I probably found the reason of this strange behavior, seems that it is
> due to the fact that the mimeTypeOf method returns a string and not an
> object when called in scalar context,
In any context mimeTypeOf() with return a MIME::Type object. This
object is overloaded to stringify into a type string, and JSONP
may not understand overloading (it uses some XS)
Show quoted text> I didn't read the documentation
> carefully (my bad) and thought the return type of this method to be
> always a string.
Show quoted text> my $ootype = $mt->mimeTypeOf($filename);
> my ($type, $enc) = MIME::Types::by_suffix($filename);
>
> $j->test->type = $ootype;
You probably want to write:
$j->test->type = "$ootype"; # explicitly stringify, work around bug in JSONP
$j->test->type = $type; # via the old interface
--
Success,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark@Overmeer.net solutions@overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net