I have downloaded a CPAN package 'Clickatell.pm' for use with a CGI script. I have uploaded it to the cgi-bin folder, set the permissions, but I can't get the script to use it.


use CGI::Carp qw(fatalsToBrowser);

print "Content-type: text/html\n\n";

use lib '/websites/123reg/LinuxPackage06/ma/sa/re/masarestaurant.co.uk/public_html/cgi-bin';

package Clickatell;

my $catell = Clickatell->new( API_ID => $api_id );

When run, I get:

"Can't locate object method "new" via package "Clickatell" (perhaps you forgot to load "Clickatell"?) at /websites/123reg/LinuxPackage06/ma/sa/re/masarestaurant.co.uk/public_html/sms.pl line 20" the final line in the clip.

What am I doing wrong?

Martin Harriss

I am not familiar with that particular package, but you're not saying:

use Clickatell;

I did a bit of research on this Clickatell thing and it appears that you have to:

use Net::Clickatell;

because it is in the package Net::Clickatell. You should place the pm in the appropriate directory within the (typically) site/lib/Net directory. This should be done for you automatically if you make install the package via Makefile.PL etc. However, if you just want to install it by hand, drop the pm in the appropriate directory.