<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Juan Carlos Corona Romero</title>
    <description>The latest articles on DEV Community by Juan Carlos Corona Romero (@jccr).</description>
    <link>https://dev.to/jccr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F265686%2F0d8dd214-3bdd-4507-b21f-32b4e431ea37.png</url>
      <title>DEV Community: Juan Carlos Corona Romero</title>
      <link>https://dev.to/jccr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jccr"/>
    <language>en</language>
    <item>
      <title>Compiling Perl for Android</title>
      <dc:creator>Juan Carlos Corona Romero</dc:creator>
      <pubDate>Tue, 27 Jun 2023 14:05:06 +0000</pubDate>
      <link>https://dev.to/jccr/compiling-perl-for-android-12a4</link>
      <guid>https://dev.to/jccr/compiling-perl-for-android-12a4</guid>
      <description>&lt;h2&gt;
  
  
  The Why
&lt;/h2&gt;

&lt;p&gt;I'm building a photo review app for Android, and I want to parse the full EXIF metadata in &lt;a href="https://github.com/lclevy/canon_cr3"&gt;Canon RAW CR3&lt;/a&gt; files.&lt;/p&gt;

&lt;p&gt;I found no better tool than &lt;a href="https://exiftool.org/"&gt;ExifTool by Phil Harvey&lt;/a&gt;. It works amazingly for this format and more!&lt;/p&gt;

&lt;p&gt;Good news: It's platform-independent!&lt;br&gt;
Not so good news: It needs Perl 😰&lt;/p&gt;
&lt;h2&gt;
  
  
  The How
&lt;/h2&gt;

&lt;p&gt;After some digging, I found this article — &lt;a href="https://appmattus.medium.com/embedding-perl-on-android-b271a1f4b013"&gt;Embedding Perl on Android&lt;/a&gt; — which covers compiling and using Perl on Android, and funny enough it also mentions using this for ExifTool 😆&lt;/p&gt;

&lt;p&gt;I reviewed the prescribed steps, but found it to be using a now &lt;a href="https://developer.android.com/ndk/guides/standalone_toolchain"&gt;obsolete method for compilation&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;🏁 Let's begin doing this the 2023 way!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Sorry Windows devs, the following assumes a UNIX-like setup, and I only tested this using macOS. Maybe WSL will work?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here's the summary of my derived approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download and install the Android NDK&lt;/li&gt;
&lt;li&gt;Download the Perl source code&lt;/li&gt;
&lt;li&gt;Set up an ARM based emulator&lt;/li&gt;
&lt;li&gt;Prepare the environment for cross-compilation&lt;/li&gt;
&lt;li&gt;Compile Perl with &lt;code&gt;Configure&lt;/code&gt; and &lt;code&gt;make&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Extract the &lt;code&gt;perl&lt;/code&gt; binary and &lt;code&gt;lib/&lt;/code&gt; outputs&lt;/li&gt;
&lt;li&gt;Try things out using ADB&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  1. Download and install the Android NDK
&lt;/h3&gt;

&lt;p&gt;The easiest way I found to do this is to download the &lt;code&gt;NDK (Side by side)&lt;/code&gt; option under the &lt;code&gt;SDK Tools&lt;/code&gt; section of the Android SDK Manager (which comes with Android Studio).&lt;/p&gt;

&lt;p&gt;It will be installed into your Android SDK Location under an &lt;code&gt;ndk/&amp;lt;version&amp;gt;&lt;/code&gt; sub directory.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Download the Perl source code
&lt;/h3&gt;

&lt;p&gt;I downloaded the latest source from the same location as the article:&lt;br&gt;
&lt;a href="https://www.cpan.org/src/"&gt;Comprehensive Perl Archive Network - Perl Source&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-O&lt;/span&gt; https://www.cpan.org/src/5.0/perl-5.36.1.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xzf&lt;/span&gt; perl-5.36.1.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;perl-5.36.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Notes
&lt;/h4&gt;

&lt;p&gt;The website's page mentions:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Read both INSTALL and &lt;strong&gt;README.android&lt;/strong&gt; [&lt;em&gt;sic&lt;/em&gt;] in the perl-5.36.1 directory for more detailed information.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Doing so I found that there is actually some useful information about &lt;a href="https://github.com/Perl/perl5/blob/blead/INSTALL#cross-compilation"&gt;cross-compilation in general&lt;/a&gt;, and &lt;a href="https://github.com/Perl/perl5/blob/blead/README.android#cross-compilation"&gt;for Android specifically&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It mentions that there's two methods for cross-compilation, one that requires access to a target system, and a second which doesn't. Since it doesn't explain the second method,  we'll setup a target system in the next step.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Set up an ARM based emulator
&lt;/h3&gt;

&lt;p&gt;Create a device in the &lt;code&gt;Virtual Device Manager&lt;/code&gt; tool included in the Android SDK (or Android Studio). &lt;/p&gt;

&lt;p&gt;You can use the recommended image, which will most likely be an &lt;code&gt;arm64&lt;/code&gt; image, if not select an &lt;code&gt;ARM Image&lt;/code&gt; manually instead.&lt;/p&gt;

&lt;p&gt;After the device is created, ▶️ start the emulator.&lt;/p&gt;

&lt;p&gt;This will be used as the target system with the target architecture for cross compilation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;After you finish this whole process, you may want to do it again and compile for different architectures. At this point you'll be creating other devices with the &lt;code&gt;armeabi&lt;/code&gt; (32 bit arm) image, or the &lt;code&gt;x86&lt;/code&gt; and &lt;code&gt;x86_64&lt;/code&gt; images.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  4. Prepare the environment for cross-compilation
&lt;/h3&gt;

&lt;p&gt;This took some trial and error, so to spare you the pain here's a script that sets up the environment for you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;### Make sure to check/modify this path to match your NDK location&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;NDK&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/Library/Android/sdk/ndk/25.2.9519653

&lt;span class="c"&gt;### Confirm this by running `adb devices`&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;DEVICE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;emulator-5554

&lt;span class="c"&gt;### A temporary path on the device that will be used during cross-compilation&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TARGETDIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/data/local/tmp

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TARGET_ARCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;aarch64-linux-android
&lt;span class="c"&gt;### OR use one of these other architectures instead:&lt;/span&gt;
&lt;span class="c"&gt;# export TARGET_ARCH=armv7a-linux-androideabi&lt;/span&gt;
&lt;span class="c"&gt;# export TARGET_ARCH=x86_64-linux-android&lt;/span&gt;
&lt;span class="c"&gt;# export TARGET_ARCH=i686-linux-android&lt;/span&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TARGET_LIB_ARCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TARGET_ARCH&lt;/span&gt;
&lt;span class="c"&gt;### OR if using armv7a-linux-androideabi as TARGET_ARCH, use this instead&lt;/span&gt;
&lt;span class="c"&gt;# export TARGET_LIB_ARCH=arm-linux-androideabi&lt;/span&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;HOST_TAG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;darwin-x86_64
&lt;span class="c"&gt;### OR if using linux, use this instead:&lt;/span&gt;
&lt;span class="c"&gt;# export HOST_TAG=linux-x86_64&lt;/span&gt;

&lt;span class="c"&gt;## The API level of the Android version you are targeting&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;BUILD_VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;23 
&lt;span class="c"&gt;## (Could also maybe use 21, but may run into compilation issues)&lt;/span&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TOOLCHAIN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$NDK&lt;/span&gt;/toolchains/llvm/prebuilt/&lt;span class="nv"&gt;$HOST_TAG&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;SYSROOT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TOOLCHAIN&lt;/span&gt;/sysroot
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;LIB_ARCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TOOLCHAIN&lt;/span&gt;/sysroot/usr/lib/&lt;span class="nv"&gt;$TARGET_LIB_ARCH&lt;/span&gt;/&lt;span class="nv"&gt;$BUILD_VERSION&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TOOLCHAIN&lt;/span&gt;/bin/llvm-ar
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TOOLCHAIN&lt;/span&gt;/bin/llvm-a
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TOOLCHAIN&lt;/span&gt;/bin/&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;TARGET_ARCH&lt;/span&gt;&lt;span class="k"&gt;}${&lt;/span&gt;&lt;span class="nv"&gt;BUILD_VERSION&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="nt"&gt;-clang&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CXX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TOOLCHAIN&lt;/span&gt;/bin/&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;TARGET_ARCH&lt;/span&gt;&lt;span class="k"&gt;}${&lt;/span&gt;&lt;span class="nv"&gt;BUILD_VERSION&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="nt"&gt;-clang&lt;/span&gt;++
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;LD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TOOLCHAIN&lt;/span&gt;/bin/ld
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;RANLIB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TOOLCHAIN&lt;/span&gt;/bin/llvm-ranlib
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;STRIP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TOOLCHAIN&lt;/span&gt;/bin/llvm-strip

&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;:&lt;span class="nv"&gt;$TOOLCHAIN&lt;/span&gt;/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Compile Perl with &lt;code&gt;Configure&lt;/code&gt; and &lt;code&gt;make&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;After executing the environment set-up script, execute the configure script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./Configure &lt;span class="nt"&gt;-des&lt;/span&gt; &lt;span class="nt"&gt;-Dusecrosscompile&lt;/span&gt; &lt;span class="nt"&gt;-Dtargetarch&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TARGET_ARCH&lt;/span&gt; &lt;span class="nt"&gt;-Dtargetrun&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;adb &lt;span class="nt"&gt;-Dcc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$CC&lt;/span&gt; &lt;span class="nt"&gt;-Dcxx&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$CXX&lt;/span&gt; &lt;span class="nt"&gt;-Dranlib&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$RANLIB&lt;/span&gt; &lt;span class="nt"&gt;-Dsysroot&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$SYSROOT&lt;/span&gt; &lt;span class="nt"&gt;-Dlibpth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$LIB_ARCH&lt;/span&gt; &lt;span class="nt"&gt;-Dtargetdir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$TARGETDIR&lt;/span&gt; &lt;span class="nt"&gt;-Dtargethost&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$DEVICE&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you get this error: &lt;code&gt;./Configure: line 4700: ./try: cannot execute binary file&lt;/code&gt; Try editing the &lt;code&gt;./Configure&lt;/code&gt; file and modifying the source code to comment out lines slightly before 4700 &lt;code&gt;# Really old versions of gcc&lt;/code&gt; for about 53 lines until &lt;code&gt;$rm -f try try.*&lt;/code&gt; 
  (Click here to see the exact lines I commented out for reference.)
  &lt;br&gt;

&lt;pre&gt;&lt;code&gt;&lt;span&gt;# $cat &amp;gt;try.c &amp;lt;&amp;lt;'EOCP'&lt;/span&gt;
&lt;span&gt;# int main(int argc, char **argv) {&lt;/span&gt;
&lt;span&gt;#     argc = argc + 1;&lt;/span&gt;
&lt;span&gt;#     /* This is deliberately a declaration after a statement. */&lt;/span&gt;
&lt;span&gt;#     unsigned long long count = 0;&lt;/span&gt;
&lt;span&gt;#     for (char **p = argv; *p; ++p) {&lt;/span&gt;
&lt;span&gt;#         ++count;&lt;/span&gt;
&lt;span&gt;#     }&lt;/span&gt;
&lt;span&gt;#     return count == 1 ? 0 : argc;&lt;/span&gt;
&lt;span&gt;# }&lt;/span&gt;
&lt;span&gt;# EOCP&lt;/span&gt;
&lt;span&gt;# c99_for=no&lt;/span&gt;
&lt;span&gt;# for flag in '' '-std=gnu99' '-std=c99'; do&lt;/span&gt;
&lt;span&gt;#     if $cc -o try $flag $ccflags $ldflags try.c 2&amp;gt;/dev/null &amp;amp;&amp;amp; ./try; then&lt;/span&gt;
&lt;span&gt;#         c99_for="$flag"&lt;/span&gt;
&lt;span&gt;#         break;&lt;/span&gt;
&lt;span&gt;#     fi&lt;/span&gt;
&lt;span&gt;# done&lt;/span&gt;
&lt;span&gt;# case "$c99_for" in&lt;/span&gt;
&lt;span&gt;# '') echo "Your C compiler doesn't need any special flags to compile C99 code"&lt;/span&gt;
&lt;span&gt;#     ;;&lt;/span&gt;
&lt;span&gt;# no) echo &amp;gt;&amp;amp;4 "Your C compiler doesn't seem to be able to compile C99 code"&lt;/span&gt;
&lt;span&gt;#     rp='Do you really want to continue?'&lt;/span&gt;
&lt;span&gt;#     dflt='n'&lt;/span&gt;
&lt;span&gt;#     . ./myread&lt;/span&gt;
&lt;span&gt;#     case "$ans" in&lt;/span&gt;
&lt;span&gt;#   [yY])   echo &amp;gt;&amp;amp;4 "Okay, continuing."    ;;&lt;/span&gt;
&lt;span&gt;#   *)  exit 1              ;;&lt;/span&gt;
&lt;span&gt;#     esac&lt;/span&gt;
&lt;span&gt;#     ;;&lt;/span&gt;
&lt;span&gt;# *)  echo "Your C compiler needs $c99_for to compile C99 code"&lt;/span&gt;
&lt;span&gt;#     ccflags="$c99_for $ccflags"&lt;/span&gt;
&lt;span&gt;#     ;;&lt;/span&gt;
&lt;span&gt;# esac&lt;/span&gt;
&lt;span&gt;# $rm -f try try.*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/p&gt;

&lt;p&gt;And compile it all by executing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  6. Extract the &lt;code&gt;perl&lt;/code&gt; binary and &lt;code&gt;lib/&lt;/code&gt; outputs
&lt;/h3&gt;

&lt;p&gt;If everything ran without error, you'll find that a &lt;code&gt;perl&lt;/code&gt; binary file is now in your working directory (the source file directory we started in)&lt;/p&gt;

&lt;p&gt;Congratulations, we have compiled Perl for Android 🎉&lt;/p&gt;

&lt;p&gt;Now let's copy this &lt;code&gt;perl&lt;/code&gt; binary file and the &lt;code&gt;lib/&lt;/code&gt; directory and run to test these outputs in the target system.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Try things out using ADB
&lt;/h3&gt;

&lt;p&gt;Push the output files into the emulator&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adb push perl /data/local/tmp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adb push lib/ /data/local/tmp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start an ADB shell&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adb shell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the shell try out your Perl distribution 🤩&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /data/local/tmp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PERL5LIB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/data/local/tmp/lib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./perl &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"print &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Hello from Android!&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It should print something out, if not try to make the file executable with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x ./perl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! Hopefully this all worked for you.&lt;/p&gt;

&lt;p&gt;If you want more ideas on how to use your Perl in an Android app &lt;a href="https://appmattus.medium.com/embedding-perl-on-android-b271a1f4b013#4d45"&gt;the article I found has some ideas&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let me know if you run into issues in the comments and I will try to work it out with you 🙌&lt;/p&gt;

</description>
      <category>android</category>
      <category>perl</category>
      <category>compiling</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
