PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, October 10, 2022

[FIXED] Why does `use GD::Graph::pie;` fail even though CPAN says that GD::Graph::pie is installed and up to date?

 October 10, 2022     gd, gd-graph, perl     No comments   

Issue

I'm trying to run a script called honeydsum.pl. It is failing a test and insisting I do not have GD::Graph::pie installed. The test that fails is:

unless (eval "use GD::Graph::pie; 1") {
   die "$program_name: please install GD::Graph::pie.";
}

Thus it gives the output:

honeydsum.pl: please install GD::Graph::pie. at ./honeydsum.pl line 65

Where I am confused is that when I check on CPAN it says GD::Graph::pie is up to date:

cpan[5]> install GD::Graph::pie
GD::Graph::pie is up to date (1.21).

I'm not a Perl expert, but is there a reason it would fail the test even if the module is installed?

Output from cpan -D:

~# cpan -D GD::Graph::pie
Reading '/root/.cpan/Metadata'
  Database was generated on Mon, 06 Mar 2017 21:17:02 GMT
GD::Graph::pie
-------------------------------------------------------------------------
    (no description)
    R/RU/RUZ/GDGraph-1.54.tar.gz
    /root/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/GD/Graph/pie.pm
    Installed: 1.21
    CPAN:      1.21  up to date
    Ruslan U. Zakirov (RUZ)
    Ruslan.Zakirov@gmail.com

There was no output from

perl -MGD::Graph::pie -e1

In my /usr/share/ directory I have the following related to perl:

  • perl/5.22
  • perl/5.22.2
  • perl5

I'm not sure what a proper perl installation would have put in this directory.


Solution

The script is using the system perl, but you installed GD::Graph::pie for a perlbrew installation. If you want the script to use your perlbrew perl, change the shebang from

#! /usr/bin/perl -T -w

to

#! /root/perl5/perlbrew/perls/perl-5.20.1/bin/perl -T -w


Answered By - ThisSuitIsBlackNot
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing