use strict; use CPANPLUS; push @INC, sub { my ($code, $file) = @_; my $module = $file; $module =~ s!/!::!g; $module =~ s!\.pm$!!g; install($module); for (@INC) { next if ref; if (-e "$_/$file" and -r _) { open my $fh, '<', "$_/$file" or die $!; return $fh; } } return undef; };