#!/usr/bin/perl -- BEGIN { package CPAN::MyConfig; $INC{'CPAN/MyConfig.pm'} = __FILE__; ... }; my $cpan = 'path/to/cpan'; do $cpan;