in reply to Use of %INC ?

You use %INC just like any other hash, except that its populated automatically by do, require and use. See perlvar for more details.

use strict; print "$_: $INC{$_}\n" for keys %INC; __END__ strict.pm: /usr/share/perl/5.10/strict.pm

Writing to %INC does have its uses. For example, when you want to define classes inside a main script:

use strict; use warnings; BEGIN { package Foo; sub new { bless {}, $_[0] } sub ima { "I'm a '", ref $_[0], "' object\n" } $INC{'Foo.pm'} = "Anything at all. It really doesn't matter"; } use Foo; my $F = Foo->new; print $F->ima, "\n"; __END__ I'm a 'Foo' object

This code dies (Can't locate Foo.pm in @INC) without the assignment to %INC. merlyn uses this technique often in his series of articles about Rose::DB.