Alien::Libxml2(3) User Contributed Perl Documentation Alien::Libxml2(3)

# [NAME](#NAME)

Alien::Libxml2 - Install the C libxml2 library on your system

# [VERSION](#VERSION)

version 0.20

# [SYNOPSIS](#SYNOPSIS)

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 ],
 );
```

# [DESCRIPTION](#DESCRIPTION)

This module provides "libxml2" for other modules to use.

# [CAVEATS](#CAVEATS)

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.

"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.

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.

# [SEE ALSO](#SEE_ALSO)

[Alien::LibXML](#Alien::LibXML)

Older Alien for the same library.

[XML::LibXML](#XML::LibXML)

Perl interface to "libxml2", which uses this Alien

# [AUTHOR](#AUTHOR)

Author: Graham Ollis &lt;plicease@cpan.org&gt;

Contributors:

Shlomi Fish (shlomif)

Shawn Laffan (SLAFFAN)

# [COPYRIGHT AND LICENSE](#COPYRIGHT_AND_LICENSE)

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.

2026-08-08 perl v5.44.0

---

Document: Alien::Libxml2(3pm) from perl-alien-libxml2 0.20-r4 (Chainguard OS)
Source: https://cpan.metacpan.org/authors/id/P/PL/PLICEASE/Alien-Libxml2-0.20.tar.gz
