a newbie encounters difficulties in using module

Discussion in 'Perl Misc' started by Rose, Feb 16, 2008.

  1. Rose

    Rose Guest

    I'm testing the codes obtained from internet:


    use Imager;
    use Imager::plot;

    $plot = Imager::plot->new(Width => 550,
    Height => 350,
    GlobalFont => 'ImUgly.ttf');

    my @X = 0..100;
    my @Y = map { sin($_/10) } @X;
    my @Z = map { 1+cos($_/10) } @X;

    $plot->AddDataSet(X => \@X, Y => \@Z);
    $plot->AddDataSet(X => \@X, Y => \@Y,
    style=>{marker=>{size => 2,
    symbol => 'circle',
    color => Imager::Color->new('red'),
    },
    });

    $img = Imager->new(xsize=>600, ysize => 400);
    $img->box(filled=>1, color=>'white');

    $plot->{'Ylabel'} = 'angst';
    $plot->{'Xlabel'} = 'time';
    $plot->{'Title'} = 'Quality time';

    $plot->Render(Image => $img, Xoff => 40, Yoff => 370);
    $img->write(file => "testout.png");

    I have already installed Imager module by CPAN.

    install Imager

    then by

    install Color

    And when I ran the test.pl by perl test.pl, the following error appears.
    What else should I do?

    Can't locate Imager/Color.pm in @INC (@INC contains:
    /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
    /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
    /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at
    Imager.pm line 7.
    BEGIN failed--compilation aborted at Imager.pm line 7.
    Compilation failed in require at tst.pl line 1.
    BEGIN failed--compilation aborted at tst.pl line 1.
     
    Rose, Feb 16, 2008
    #1
    1. Advertising

  2. Rose

    Ben Morrow Guest

    Quoth "Rose" <>:
    > I'm testing the codes obtained from internet:
    >
    >
    > use Imager;
    > use Imager::plot;

    <snip>
    >
    > I have already installed Imager module by CPAN.
    >
    > install Imager
    >
    > then by
    >
    > install Color


    There is a module called 'Color' on the CPAN, but it has nothing to do
    with Imager. If you meant Imager::Color, then that is part of the Imager
    distribution and should have been installed along with Imager.

    > And when I ran the test.pl by perl test.pl, the following error appears.
    > What else should I do?
    >
    > Can't locate Imager/Color.pm in @INC (@INC contains:


    This makes no sense. Somehow you seem to have installed Imager.pm
    without Imager/Color.pm, which should be impossible. I would suggest you
    try reinstalling Imager.

    Ben
     
    Ben Morrow, Feb 16, 2008
    #2
    1. Advertising

  3. On Sat, 16 Feb 2008 16:15:15 +0000, Ben Morrow <>
    wrote:

    >> Can't locate Imager/Color.pm in @INC (@INC contains:

    >
    >This makes no sense. Somehow you seem to have installed Imager.pm
    >without Imager/Color.pm, which should be impossible. I would suggest you
    >try reinstalling Imager.


    Unless she "installed" by copying Imager.pm into the appropriate
    directory, which in "I'm testing the codes obtained from internet"
    context may not be completely unreasonable as a possibility.


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Feb 16, 2008
    #3
  4. Rose

    Ben Morrow Guest

    Quoth Michele Dondi <>:
    > On Sat, 16 Feb 2008 16:15:15 +0000, Ben Morrow <>
    > wrote:
    >
    > >> Can't locate Imager/Color.pm in @INC (@INC contains:

    > >
    > >This makes no sense. Somehow you seem to have installed Imager.pm
    > >without Imager/Color.pm, which should be impossible. I would suggest you
    > >try reinstalling Imager.

    >
    > Unless she "installed" by copying Imager.pm into the appropriate
    > directory, which in "I'm testing the codes obtained from internet"
    > context may not be completely unreasonable as a possibility.


    No, but she did say

    > >> I already installed Imager by CPAN.
    > >>
    > >> install Imager


    which ought to have done the right thing.

    Ben
     
    Ben Morrow, Feb 16, 2008
    #4
  5. On Sat, 16 Feb 2008 23:55:19 +0000, Ben Morrow <>
    wrote:

    >> Unless she "installed" by copying Imager.pm into the appropriate
    >> directory, which in "I'm testing the codes obtained from internet"
    >> context may not be completely unreasonable as a possibility.

    >
    >No, but she did say
    >
    >> >> I already installed Imager by CPAN.
    >> >>
    >> >> install Imager

    >
    >which ought to have done the right thing.


    Sorry!


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Feb 17, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert
    Replies:
    3
    Views:
    596
    Tris Orendorff
    Oct 6, 2003
  2. Afshar
    Replies:
    2
    Views:
    371
    Afshar
    Apr 10, 2008
  3. Eduardo Alvarez

    mailbox module difficulties

    Eduardo Alvarez, Nov 28, 2011, in forum: Python
    Replies:
    3
    Views:
    161
    Eduardo Alvarez
    Nov 28, 2011
  4. Replies:
    5
    Views:
    144
    Dr John Stockton
    Mar 2, 2005
  5. BobAalsma
    Replies:
    4
    Views:
    117
    Chris Angelico
    Oct 7, 2013
Loading...

Share This Page