lyman has asked for the wisdom of the Perl Monks concerning the following question:

Dear Perl Monks,

I'm an experienced perl programmer, and am having difficulty getting the module XS-Typemap::Typemap to work. It needs an XS.pm . I have searched, searched, and pulled out a lot of hair, and I cannot find what I must install to get an XS.pm . No, it's not something::XS or XS:something, just plain XS. I have installed Debian apts

  libx11-xcb
  libx11-xcb-dev
  libx11-protocol-perl
  libx11-protocol-other-perl
  libx11-xcb-perl
  xorg-dev
  libxext-dev
  libxfexes-dev
  libx11proto-dev
  libxmu-dev
  libxmuu-dev
  libxt-dev
  xutils-dev
  libperl-dev
I find on metacpan.org/search dozens of modules with "XS" in their names, but not plain XS.pm . How do I install this XS.pm, so that XS-Typemap::Typemap will work?

Many thanks,

Lyman

Replies are listed 'Best First'.
Re: Where is plain XS.pm?
by choroba (Cardinal) on May 22, 2025 at 20:50 UTC
    Why do you need XS-Typemap::Typemap?

    I'm no expert on XS, but it seems XS.pm is something you write yourself in your distribution, which then serves as the interface between XS code and Perl code, see for example Cpanel::JSON::XS file list.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re: Where is plain XS.pm?
by tonyc (Friar) on May 23, 2025 at 03:30 UTC

    What are you trying to do with this module? What needs it?

    The XS::Typemap others have mentioned is bundled with perl but not installed in recent-ish perls since it's only useful for testing the typemap bundled with perl

    There's three different XS.pm files bundled with the perl source itself and I expect many more on CPAN, so finding the right one (if needed) is going to need more information.

Re: Where is plain XS.pm?
by swl (Prior) on May 22, 2025 at 22:18 UTC

    Do you mean XS::Typemap? This is a core perl module so should already be installed.

      As a module that's only needed when installing modules, package managers might place it in a different package than the rest of Perl.

        XS::Typemap isn't installed normally, its only purpose is to test the typemap bundled with perl.
Re: Where is plain XS.pm?
by hippo (Archbishop) on May 23, 2025 at 10:45 UTC
    I'm an experienced perl programmer, and am having difficulty

    Hello, lyman and welcome to the Monastery. As an experienced Perl programmer you will be well aware that the best thing to do when asking for help with a specific problem such as this is to provide an SSCCE. That will ensure that the answers provided will address the specific problem rather than any vague description such as "It needs an XS.pm".

    If you can provide that then I am sure you will receive a wise and relevant response in short order.


    🦛

Re: Where is plain XS.pm?
by jdporter (Paladin) on May 23, 2025 at 13:25 UTC

    Hello, lyman! Welcome to the Monastery. We are glad you're here!

Re: Where is plain XS.pm?
by Anonymous Monk on May 23, 2025 at 19:12 UTC

    XS-Typemap::Typemap is not a valid module name, because module names must be alphanumerics plus underscores, at least when ignoring UTF-8 stuff. Yes, I get the error message Can't locate XS.pm in @INC ... when I try it, but while I would hope Perl would give a sensible error message given an invalid module name, I don't know that I would expect it. Where are you getting XS-Typemap::Typemap? Meta::CPAN appears not to know about it, and 02packages.details.txt.gz does not contain it.

      Correction to myself: when I pontificated about valid module names, I omitted to mention the double colon ('::') used for punctuation between name segments, and corresponding to the path separator when Perl looks for the file containing the module. The point I was trying to make (too tersely) was that a dash (a.k.a HYPHEN-MINUS) is not valid in a module name.