Here are several solutions.
The ^ operator documented in perlop looks identical to xor_buf, so you don't need it at all.
Answering your original question, check whether this code to do a delayed use is cross-platform, but I think it should be:
unless ($INC{"Math/XOR.pm"}) {
require Math::XOR;
Math::XOR->import();
}
Or you can just live with the fact that require by itself doesn't do an import, and you can fully qualify the function name. Or you can do it manually as follows:
require Math::XOR;
*xor_buf = \&Math::XOR::xor_buf unless defined &xor_buf;
Update: PodMaster is correct. I added the .pm that I was missing.
UPDATE 2: Gah. I missed :: to / as well. I swear I was thinking it as I typed it... |