in reply to Re^2: retailed (embedded) perl
in thread retailed (embedded) perl
In addition to paths, @INC can contain code refs (and a couple of other things). When trying to load a module, Perl iterates over @INC until the module is loaded. If a path is encountered, Perl looks for the module in that directory. If a code ref is encoutered, Perl calls the code ref with the name of the module to load.
The snippet places a code ref at the @INC's head, causing it to be called first. When called, it displays the name of the module Perl is attempting to load. It doesn't load the module, so Perl proceeds with the next entry in @INC.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: retailed (embedded) perl
by earlati2 (Beadle) on Sep 07, 2006 at 06:52 UTC | |
by grantm (Parson) on Sep 11, 2006 at 08:51 UTC |