No, it's primarily about interfacing with an existing C library
Thanks...that makes a lot of sense. cavac's point about security resonates here -> Re^2: XS Modules - why and when?
But in RPi::DHT11, there doesn't seem to be any reason to use XS unless the C code already existed. I had assumed stevieb wrote the C code as well as the Perl code, but I have nothing to base that on.
If we look at RPi::PIGPIO::Device::DHT22 we can see a pure Perl method of reading the output from the device (DHT11 and DHT22 are read the same way). As Perl is rather good at bitwise and mathematical operations, it just seems weird to me that XS would be used in this situation.
In reply to Re^2: XS Modules - why and when?
by Bod
in thread XS Modules - why and when?
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |