manishrathi has asked for the wisdom of the Perl Monks concerning the following question:

There are many perl modules, which if I want to use I have to specify that module in the code.
There are many functions to manipulate array. These functons belong to which module ? which is the basic module which gets loaded in the perl code automatically and contains all these subroutines
  • Comment on what module gets loaded with perl program by default ?

Replies are listed 'Best First'.
Re: what module gets loaded with perl program by default ?
by chromatic (Archbishop) on Jan 09, 2010 at 10:17 UTC

    Do you mean keywords such as push, pop, and splice? Those are features of the language itself, implemented in the C language inside the perl binary. If you browse the Perl 5 source code, look for functions named pp_push, for example; that's the implementation.

Re: what module gets loaded with perl program by default ?
by GrandFather (Saint) on Jan 09, 2010 at 10:54 UTC

    If you don't use use or require then no modules are loaded. Out of the box Perl is a very capable language with powerful string, array and hash manipulation built in. In the sense that you imply, no modules are loaded automatically. You should of course always use strictures (use strict; use warnings;), although they are actually pragmas rather than modules and are effectively built in.


    True laziness is hard work
Re: what module gets loaded with perl program by default ?
by cdarke (Prior) on Jan 09, 2010 at 16:41 UTC
    If you want to know what modules have been loaded, then inspect the %INC hash (see perlvar).

    Perl builtins which manipulate an array belong to a pseudo namespace called CORE, see CORE.

    Actually there are not that many functions that manipulate an array (push,pop,shift,unshift,splice), most work on a list.
Re: what module gets loaded with perl program by default ?
by Anonymous Monk on Jan 09, 2010 at 09:50 UTC