main.pl:

Install Perl (probably already installed):

sudo apt-get install perl
Need to install the FFI::Raw module:
sudo perl -MCPAN -e 'install FFI::Raw'
Run it
perl main.pl
or (if it's executable)
./main.pl

#!/usr/bin/perl

use strict;

use FFI::Raw;

my $add = FFI::Raw->new(
  './libhello.so', 'add',
  FFI::Raw::int, # return type
  FFI::Raw::int, # first arg type
  FFI::Raw::int  # second arg type
);

my $printme = FFI::Raw->new(
  './libhello.so', 'printme',
  FFI::Raw::void, # return type
  FFI::Raw::str   # arg type
);

print "The result is " . $add->call(1, 2) . "\n";
print $printme->call("Hello from Perl!");

Output:
The result is: 3
Hello from library: Hello from Perl!