How to run a basic Perl script?

lost4ever

Registered
Nov 15, 2019
1
0
1
Hong Kong
cPanel Access Level
Website Owner
I am on a shared host that uses cPanel. My aim is to use ExifTool, which can be installed from cPanel. But with not too much knowledge about Perl I am stuck.

What I managed so far:

I did a test.pl and put that into cgi-bin - and it worked fine!

Perl:
#!/usr/bin/perl -w
print "Content-type:text/html\n\n";
print "hello world";
Multible tries with #!/usr/bin/exiftool so far failed.

So how do I run a Perl module, or better, a Perl module in a PHP environment?
 

kadrin

Member
Nov 13, 2019
24
3
3
Italy
cPanel Access Level
Website Owner
Try perl -T
Code:
#!/usr/bin/perl -T

use 5.010;
use CGI;

use strict;
use warnings;

my $q = CGI->new();
say $q->header(), $q->start_html();
my $file = '../_new.jpg';
$file = '../DSC4883.jpg';
use Image::ExifTool qw(:Public);
my $exifTool = new Image::ExifTool;