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.

#!/usr/bin/perl

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

Recommended Answers

All 3 Replies

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.

Many thanks mitchems!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.