This Magisk module contains the Perl 5.44 binaries compiled with clang19 and the Android NDK r27b for arm64 CPUs.

ASUS_I006D:/ $ perl --version

This is perl 5, version 44, subversion 0 (v5.44.0) built for aarch64-linux-android

Copyright 1987-2026, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.

ASUS_I006D:/ $ 


The perl executables and scripts are installed in /system/usr/bin.


The perl binary is a dynamically linked executable but only for the standard Android OS libraries:

ASUS_I006D:/ # file /system/usr/bin/perl5.44.0
/system/usr/bin/perl5.44.0: ELF shared object, 64-bit LSB arm64, dynamic (/system/bin/linker64), for Android 31, built by NDK r27b (12297006), not stripped
ASUS_I006D:/ # 

ASUS_I006D:/ # ldd /system/usr/bin/perl5.44.0
	linux-vdso.so.1 => [vdso] (0x7ee3c6b000)
	libc.so => /apex/com.android.runtime/lib64/bionic/libc.so (0x7ede6a9000)
	libdl.so => /apex/com.android.runtime/lib64/bionic/libdl.so (0x7ede7d5000)
	libm.so => /apex/com.android.runtime/lib64/bionic/libm.so (0x7ede641000)
ASUS_I006D:/ # 


There is a wrapper script for the Perl executables in /system/bin:

ASUS_I006D:/ # ls -l /system/bin | grep perl_wrapper
lrwxrwxrwx 1 root root       14 1970-02-01 23:12 cpan -> ./perl_wrapper
lrwxrwxrwx 1 root root       14 1970-02-01 23:12 instmodsh -> ./perl_wrapper
lrwxrwxrwx 1 root root       14 1970-02-01 23:12 perl -> ./perl_wrapper
lrwxrwxrwx 1 root root       14 1970-02-01 23:12 perl5.44.0 -> ./perl_wrapper
-rwxr-xr-x 1 root root      241 2026-07-21 13:29 perl_wrapper
lrwxrwxrwx 1 root root       14 1970-02-01 23:12 perlbug -> ./perl_wrapper
lrwxrwxrwx 1 root root       14 1970-02-01 23:12 perldoc -> ./perl_wrapper
lrwxrwxrwx 1 root root       14 1970-02-01 23:12 perlivp -> ./perl_wrapper
lrwxrwxrwx 1 root root       14 1970-02-01 23:12 perlthanks -> ./perl_wrapper
ASUS_I006D:/ #

The wrapper script reads and executes the shell script /system/bin/perl_env. 

The script /system/bin/env reads the file ${HOME}/perl_env if it exists.  ${HOME}/perl_env can therefore be used to define the perl environment.


The Perl scripts, such as cpan, do not work with the crippled tools binaries from Android. Therefore, these binaries are also in the Magisk Module:

gpg gzip bzip2 less unzip wget2 tar unzip

The Perl config files are prepared to use these binaries.


The customize script creates the CPAN config file

/data/local/tmp/perl_home/.cpan/CPAN/MyConfig.pm

if it does not yet exist. 


If a C/C++ compiler is necessary for installing a Perl Module you can install one of the Magisk Modules with clang -- see here:

http://bnsmb.de/Magisk_Modules.html#Documentation_for_the_Magisk_Module_with_clang19_and_the_NDK_r27b


Precompiled libraries and headers that are required for compiling a Perl Module in Android on arm64 CPUs are in this GitHub repository:

https://github.com/bnsmb/libraries-and-include-files-for-Android-on-arm64-CPUs


The Perl configuration for compiling new Perl modules with a C or C++ compiler is in the file

/system/usr/lib/perl5/5.44.0/aarch64-linux-android/Config_heavy.pl

Edit this file to use a different C compiler when creating new Perl modules.

Note:

To modify the file Config_heavy.pl, edit the file in the Magisk Module, /data/adb/modules/perl544/system/usr/lib/perl5/5.44.0/aarch64-linux-android/Config_heavy.pl, as user root and reboot the phone.



Notes

Perl Modules can be installed cpan; in the default configuration cpan installs Perl Modules in the directory ${HOME}/lib/perl/aarch64-linux-android.

The environment variable HOME must contain the name of a directory on a writable filesystem to use cpan.
The wrapper script used in this Magisk Module for all perl executables in /system/bin, /system/bin/perl_wrapper, sets the variable HOME to /data/local/tmp/perl_home if it is empty or contains "/"
(in the default config in adb shells in Android the variable HOME is "/")


To print the list of directories used for perl modules use the command

perl -e 'print join "\n", @INC'

e.g.:

ASUS_I006D:/ $ perl -e 'print join "\n", @INC'
/data/local/tmp/perl_home/lib/perl5/aarch64-linux-android
/data/local/tmp/perl_home/lib/perl5
/data/local/tmp/perl_homelib/perl5/aarch64-linux-android
/lib/perl5
/system/usr/lib/perl5/system/usr/lib/perl5/5.44.0
/system/usr/lib/perl5/site_perl/5.44.0/aarch64-linux-android
/system/usr/lib/perl5/site_perl/5.44.0
/system/usr/lib/perl5/5.44.0/aarch64-linux-android
/system/usr/lib/perl5/5.44.0ASUS_I006D:/ $ 


The libraries required by some of the object files in this Magisk Module are in the directory /system/usr/lib.


The detailed documentation for this Magisk Module can be found here:

http://bnsmb.de/Magisk_Modules.html#Documentation_for_the_Magisk_Module_with_Perl_5.42


The Perl binaries were build using the clang19 from this Magisk Module

http://bnsmb.de/Magisk_Modules.html#Documentation_for_the_Magisk_Module_with_clang19_and_the_NDK_r27b

the Bison/yacc binary from this Magisk Module

http://bnsmb.de/files/public/Android/MagiskModules/bison_flex_1.2.0.zip


 
The directory structure in this Magisk Module was created on a phone using an overlay mount created with the script

http://bnsmb.de/files/public/Android/create_overlay_mount.sh



The config files and patches used to compile perl are in the directory ./source in the Magisk module


A log of "make test" for this perl binary is also in the directory ./source: perl544_make_test.log


History

18.07.2026 5.44.0-v1.0.0

  initial version of the Magisk Module with Perl 5.44

21.07.2026 5.44.0-v1.1.0
  patches from Termux for Perl applied 
  removed the broken symbolic link /system/bin/perl5.42.0
  added the libraries required by some of the object files in this Magisk Module

25.07.2026 5.44.0-v1.1.1
  rebuild all perl object files with -fPIC 
  added the script list_installed_perl_modules
  added the script test_installed_perl_modules 
  added the script list_perl_module_pathes
  added the script perl-deps.pl
  added the binary jq (jq - commandline JSON processor [version 1.7.1]); jq is used by the script perl-deps.pl if the Magisk module JSON is not installed
  added the binaries gpg gzip bzip2 less unzip wget2 tar unzip (the Perl utils do not work with the crippled Android Unix tools)
  recompiled the Perl binaries with the clang19 from the Magisk Module
  the config files for compiling Perl modules are now prepared for using the clang19 and the Android NDK from the Magisk Module with the clang 
  fixed the buggy Perl module for zlib
  added the additional libraries and include files necessary to build Perl


