Alien::Libxml2(3)

πŸ“¦
version 0.20 Β· 5 versions
, in fedora 43

πŸ’– Alien::Libxml2 πŸ’–

okay so bestie, this is a manual page from the User Contributed Perl Documentation, section 3, and it's about a lil module called Alien::Libxml2. It's literally the icon that gets the C libxml2 library onto your system so other Perl stuff can use it. Let's get into it 🫢


✨ NAME ✨

Alien::Libxml2 β€” install the C libxml2 library on your system πŸ’…


🌸 VERSION 🌸

version 0.20 β€” that's the one, bestie ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

so like, depending on what you're building, you call it a different way. three whole vibes, take your pick:

In your Makefile.PL:

use ExtUtils::MakeMaker;
use Alien::Base::Wrapper ();

WriteMakefile(
  Alien::Base::Wrapper->new('Alien::Libxml2')->mm_args2(
    # MakeMaker args
    NAME => 'My::XS',
    ...
  ),
);

In your Build.PL:

use Module::Build;
use Alien::Base::Wrapper qw( Alien::Libxml2 !export );

my $builder = Module::Build->new(
  ...
  configure_requires => {
    'Alien::Libxml2' => '0',
    ...
  },
  Alien::Base::Wrapper->mb_args,
  ...
);

$build->create_build_script;

In your FFI::Platypus script or module:

use FFI::Platypus;
use Alien::Libxml2;

my $ffi = FFI::Platypus->new(
  lib => [ Alien::Libxml2->dynamic_libs ],
);

no cap, that's the whole flow. pick the one that matches your build system and go off πŸ‘‘


πŸ’€ DESCRIPTION πŸ’€

This module provides libxml2 for other modules to use. that's it, that's the job, and it does it flawlessly πŸŽ€


πŸ™ˆ CAVEATS πŸ™ˆ

okay so listen up because this part matters:

  • There was an older existing Alien::LibXML, but it uses the older Alien::Build::ModuleBuild and the author prefers this version, which is based on the more robust alienfile system. periodt. πŸ’…
  • libxml2 has some optional prereqs, including zlib and iconv. For a share install you will want to make sure that these are installed prior to installing Alien::Libxml2 if you want to make use of features relying on them. yes, order matters bestie 😭
  • For a system install, you want to make sure the development packages for libxml2, zlib and iconv are installed if libxml2 has been configured to use them, otherwise XML::LibXML will not install as expected. If the tests for this module fail with a missing iconv.h or zlib.h, then this is likely the reason. 🫠
bestie. if it's failing and you see iconv.h or zlib.h in the error, it's this. it's always this. go install the dev packages and come back πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

  • Alien::LibXML β€” Older Alien for the same library.
  • XML::LibXML β€” Perl interface to libxml2, which uses this Alien.

πŸ’œ AUTHOR πŸ’œ

Author: Graham Ollis <plicease@cpan.org>

Contributors:

  • Shlomi Fish (shlomif)
  • Shawn Laffan (SLAFFAN)

shoutout to the whole squad for making this happen 🫢✨


This software is copyright (c) 2013-2024 by Graham Ollis.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page, bestie!! πŸŽ€βœ¨πŸ’–

cute lil sign-off: this one came from perl version v5.42.0, dated 2025-07-25 🌸 go forth and link your XML, you've got this πŸ‘‘πŸ’…

πŸ“¦ where this page comes from