Sunday, May 20, 2012

installing Perl module on dreamhost

K wanted me to include mp3 tags on the downloads at Googled installing Perl Module without root access, and found lots of people doing it, so went on to install MP3::Tag module without root access.

First I tried the procedure at
but the perl process kept getting killed as given at

Dreamhost recommends installing via the CPAN command, as given at
and then the process doesn't get killed.

But the wiki had some bugs. Got errors like

Cannot gzopen $ENV{HOME}/.cpan/sources/authors etc. Googled it and found
where the user k2S explains that he did two things differently from the wiki page
that is

**don't forget to add the suggested lines into your '~/.bash_profile' - that is, not ~/.profile
 ** test command 'echo $PERL5LIB', it should return the correct path

* *I had to edit also ~/.cpan/CPAN/ and replace all '$ENV{HOME}' with the correct path

Once I did this, the install worked fine, with perl -MMP3::Tag -e 1 not returning any errors.
 (I had actually done the manual config of the  as given in the wiki, too.)

After the module installation, some trial scripts still gave errors. Trying out a basic script from
got errors like
Can't call method "get_tags" on an undefined value

Found this explanation, that it is because the file has no tag to begin with:

Then tried tagging the file with no tag to start with, and got errors like:
Can't call method "new_tag" on unblessed reference at ./ line 6.

Problem was - the filename has to have the full path, and not start with ~/
Once that was done, the script worked. Now to work out some sort of tagging scheme, after which the tagging can be done.

No comments:

Post a Comment