"not found: No such file or directory at /opt/local/lib/perl5/site_perl/5.26/darwin-thread-multi-2level/GD/Image.pm line 64."

I'm guessing you're using MacPorts (which is how I usually use Perl on macOS); /opt/local is the default MacPorts prefix, and …/perl5/site_perl is where cpan/cpanm (from MacPorts) would try installing modules. Have you tried installing GD from MacPorts (i.e. not through cpan/cpanm)?

sudo port install p5.26-gd

Edit: You first mention Perl 5.28 (on the newer MacBook), but this error has 5.26; so maybe what you're after is installing p5.28-gd instead.

Some things to be mindful of with MacPorts are that it offers multiple versions of Perl, which can be installed simultaneously. (5.26 and 5.28 are the ones currently with installable modules.) Since each Perl version installed by MacPorts is independent, so are any modules that are installed for each version.

Although MacPorts' Perl can be invoked using a perl command if the perl5 port is installed, it may be safer to specify which version of Perl to use using a versioned command, e.g. perl5.28. Some utilities currently don't have unversioned commands, e.g. cpanm must be specified as cpanm-5.28.

Edit 2: Rather than jumping straight into MacPorts details, I should probably instead advocate taking a step back to decide how you're going to use Perl on these Macs: whether to use a general-purpose package manager (Homebrew, MacPorts, Fink), a Perl-specific distribution (Perlbrew, ActivePerl, etc.), or going with macOS' included system Perl. I don't think it is a good choice to get comfortable with macOS' included Perl; it's virtually unsupported compared to the alternatives, and it will not be present in some future macOS version (the upcoming version of macOS, 10.15 "Catalina", claims to include Perl and other scripting languages only for compatibility), so you may eventually have to find an alternative anyways. Each choice for obtaining Perl has different audiences/purposes/goals/etc., and I have no idea which one the Perl community is most familiar with or willing to help others navigate. But I'm inclined to guess that either Homebrew or Perlbrew is the most popular choice.


In reply to Re: Image.pm not found by chrstphrchvz
in thread Image.pm not found by linus8989

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.