• http://spiritofnine.com hargrove

    To install a module from the command line:

    sudo perl -MCPAN -e shell

    The first time you run it, it’ll ask if you want it to auto-configure.  Just say yes and then take the default answers for whatever else it asks.  Once that’s done, in the future, installing a module is pretty much a two-step process:

    sudo perl -MCPAN -e shell

    install Net::LastFM

    Along the way, it may ask you other questions.  I’ve found that accepting the default answer is sufficient 99.99% of the time.

    Good work so far!  You’re really making progress.

  • http://spiritofnine.com hargrove

    Also, Data::Dumper is a wonderful tool.  It give a great (confusing?) visual representation of the data structure.  Sometimes it takes a bit of effort to figure it out, but it’s well worth it.

  • Anonymous

    Ya, it does look a little confusing now, but I’m guessing as I get better with Perl, that info will make more sense. That’s good to know about installing through ‘perl’. I assume it will also download and install all prerequisite modules like the cpanm script does. ‘cpanm’ didn’t ask me anything once I figured out it needs the –sudo option. Actually, when it failed, it gives you a nice list of possible fixes for the failure. I was very impressed by that.

    • http://spiritofnine.com hargrove

      Whether it downloads and install prerequisites is part of the CPAN configuration.  If you accept the defaults, it should configure itself to do that.  sudo is necessary because modules are being installed in /usr/lib or something like that, which requires greater privileges.

    • Anonymous

      I got why the sudo was necessary when I saw the error message. I know that /usr/bin or where ever it was going was not privileged to myself. It was actually quite refreshing to be able to solve a problem instead of fighting with iOS and Xcode to get something to work.

      • http://spiritofnine.com hargrove

        When all else fails, sudo.