cancel
Showing results for 
Search instead for 
Did you mean: 

Facebook API using F9 CGI script

andysut
Newbie
Posts: 2
Registered: ‎01-02-2008

Facebook API using F9 CGI script

Hi all,
I am reasonably OK at writing PERL and have some working scripts in my webspace. I'm trying to write a Facebook application and have sussed that I need to use CPAN and a Facebook library. I've sussed (I think) that my F9 CGI space does not give me root access so I'm using some alternative instructions which say:
Using CPAN with Non-Root Access
First, run CPAN to set it up initially...
  perl -MCPAN -eshell
And then in your CPAN MyConfig.pm file (~/.cpan/CPAN/MyConfig.pm) add this line after 'make_install_arg'.
'makepl_arg' => q[PREFIX=~/ SITELIBEXP=~/lib/perl5 LIB=~/lib/perl5 INSTALLMAN1DIR=~/share/man/man1 INSTALLMAN3DIR=~/share/man/man3 INSTALLSITEMAN1DIR=~/share/man/man1 INSTALLSITEMAN3DIR=~/share/man/man3],
Then in the console do:
  export PERL5LIB="$HOME/lib/perl5"
or for if that doesn't work try (csh):
  setenv PERL5LIB "$HOME/lib/perl5"
You might want to add this line to your ~/.profile or other startup file so that this is set for other sessions.
Then to actually install the module:
  perl -MCPAN -eshell
  install WWW::Facebook::API
In your scripts you may need to add the following line (above any use WWW::Facebook::API line)
  use lib qw(/home/user/lib/perl5);
And all should be good!

which doesn't seem to work - I fall flat at the first stage with this error message:
Terminal does not support AddHistory.
Your configuration suggests "/root/.cpan" as your
CPAN.pm working directory. I could not create this directory due
to this error: mkdir /root/.cpan: Permission denied at /usr/share/perl/5.8/CPAN.
pm line 553

Please make sure the directory exists and is writable.

Can anyone help set me off in the right direction please? And, in anticipation, I also don't know where to find and edit that config file ...
Many thanks
Andy
2 REPLIES 2
Colin
Grafter
Posts: 1,264
Registered: ‎04-04-2007

Re: Facebook API using F9 CGI script

Hmm, at a guess, it's because one of our Networks staff have set up CPAN as root (so they could install perl libraries system-wide), users can't do this.
One option if you need to install locally custom Perl modules is to download them and build them manually instead of trying to use CPAN - it's not that hard a process.
andysut
Newbie
Posts: 2
Registered: ‎01-02-2008

Re: Facebook API using F9 CGI script

Thanks, that sounds like the way to go ... I'll try to track down what I need. Anyoneknow what I need and where to get it?
Cheers