Convert::Scalar unfortunately is not an option, as it requires at least
SOAP::Lite currently supports perls as old as 5.5.4, and will continue
to support 5.6 for some time (there's still systems shipped with 5.6 as
their default perl).
Thanks for the idea,
Am Samstag, den 08.03.2008, 15:38 -0800 schrieb David Aguilar:
> NOTE: I am not subscribed to the devel list, so please CC: me on all
> replies. Thank you!
> The last time I checked (which may have been around the 0.67 days)
> SOAP::Lite was using regular expressions to decide how to encode a
> value. So, for instance, a string that looked like "1.40" would get
> interpreted as being a (?) xsd:float and we'd lose the trailing zero
> when it makes it to the receiver (assuming the server is soap::lite
> and is generating the "1.40" string).
> The simplest way to reproduce this is to return a hash ref such as:
> "this should be a string" => "1.40",
> After digging into this further I discovered the Sv*OK family of
> perlapi macros. These allow you to test the underlying C datatype and
> determine the true "type" of a scalar without having to use regular
> expressions (and thus, is probably faster too).
> Currently, these macros are exported by the Convert::Scalar module:
> I just finished helping the c::s author update the API so that it is
> compatible with perl 5.10's perlapi. If you are using 5.10 (or
> debian, which has backported the api changes to 5.8.8) then use c::s
> 1.04. c::s 1.03 is suitable for pre-5.10.
> So.. long story short:
> Would the developers of SOAP::Lite be adverse to adding a dependency
> on Convert::Scalar so that SOAP::Lite's value type-detection routine
> can use Convert::Scalar's nok and pok functions for helping to
> determine a scalar's underlying type?
> I'm asking because I haven't yet written these patches and would like
> to know whether an additional dependency would be accepted upstream or
> whether this is a change that I'll have to apply to my local tree and
> maintain separately.
> As it is, there is no other way to test the type of a perl scalar.
> Perl scalars are too magical because of the autoconversion between
> double, int, and string. Convert::Scalar lets us cheat and use the
> perlapi to ask these questions, which is both more robust and faster
> than using regular expressions.