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

Active Member
Nov 13, 2019
33
6
8
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;
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
  • Like
Reactions: kadrin