linux poison RSS
linux poison Email

Create perl binaries from perl scripts

You can have list of examples by just

man perlcc

First let us generate a perl script, create a file call hello

print "hello world. ";

Convert it into executable,

chmod +x hello

Try to run it, that is our normal perl script. To make it as a binary with ELF header, do this

perlcc -o hello-bin hello

So what is the different? Check with file command,

file hello*


hello:     perl script text executable
hello-bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.4, dynamically linked (uses shared libs), not stripped

File shows that “hello” is perl script, where “hello-bin” is a ELF executable binary file.


Post a Comment

Related Posts with Thumbnails