in reply to Twofer: 'use base' vs 'use'; and SuperSearch

use base 'Something' is more or less the same as use 'Something'; push @ISA,"Something";. In other words, use base inserts the specified module as a superclass of the current package. Also use base does NOT complain if the corresponding module file (i.e. 'Something.pm') doesn't exist.

see also base and Exporter.

Replies are listed 'Best First'.
Re^2: Twofer: 'use base' vs 'use'; and SuperSearch
by jbert (Priest) on Dec 15, 2006 at 10:44 UTC
    That makes base sound worse than it is. If you write:
    #!/usr/bin/perl use strict; use warnings; use base qw/Kjfnekjrn/;
    you get:
    Base class package "Kjfnekjrn" is empty. (Perhaps you need to 'use' the module which defines that package f +irst.) at tt.pl line 4 BEGIN failed--compilation aborted at tt.pl line 4.
    You're absolutely right that it isn't complaining that it couldn't find the file, but the error message is helpful and to the point, in my opinion.