Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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/"}) { 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...

In reply to Re: require Math::XOR by tilly
in thread require Math::XOR by esskar

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2023-06-06 23:35 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (29 votes). Check out past polls.