I'm using Strawberry Perl (64-bit) Portable 5.30.1.1-64bit in a Windows 7 OS here. I used minicpan to download the cpan to a local directory D:\Perl\strawberry\cpan\sources.

My portable strawberry perl is in the directory D:\Perl\strawberry. I had a look at the Config.pm located in D:\Perl\strawberry\perl\lib\CPAN

I only adapted the path in the following lines:

if ( -d 'D:\\Perl\\strawberry\\cpan\\sources' ) { # If we are on fake Hotel/Airport wireless, # prefer the minicpan to the poisoned wireless. eval { require LWP::Online; }; unless ( $@ ) { if ( LWP::Online::online() ) { push @urllist, q[file:///D:/Perl/strawberry/cpan/sources/]; } else { unshift @urllist, q[file:///D:/Perl/strawberry/cpan/sources/]; } } }

After opening the portableshell.bat, I enter cpan and then the cpan-shell appears. Then I tried to install a module via install Text::Trim and it worked fine.

Some days later I tried again to install a module. But it did not work. The cpan-shell complained that it could not find 01mailrc.txt.gz although it was there. And then was using LWP to try to download it instead of using my local one.

After some investigation I could discover that the cpan-shell always tries to download this file again if its date is not of today. So I changed the code in the Config.pm at the beginning as follows:

use File::Touch; my @file_list = ( q[D:/Perl/strawberry/cpan/sources/authors/01mailrc.txt.gz], q[D:/Perl/strawberry/cpan/sources/modules/02packages.details.txt.gz] +, q[D:/Perl/strawberry/cpan/sources/modules/03modlist.data.gz] ); touch(@file_list);

It worked again. But this cannot be the right way to do it.

How do I have to config cpan properly that it uses my offline cpan although in the net there would be a newer cpan-archive? I just want to use the cpan-archive I downloaded via minicpan offline.

Then I have seen that there exists a per user config for cpan too, i.e. /.cpan/CPAN/MyConfig.pm. In my case this file is not present at the moment. Should I use it?

I know that this is a common topic and already often discussed. But nevertheless I was not able to find a good solution for my case. Thank you for your help!


In reply to Offline cpan used by strawberry perl by Dirk80

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.