Perl for Newbies - Part 3 - Modules and ObjectsPerl ModulesThe "main" Namespace

3.4. The "main" Namespace

One can access the main namespace (i.e, the namespace of the script), from any other namespace by designating main as the namespace path. For instance, main::hello() will invoke the function named "hello" in the script file.

Usually, the "main" part can be omitted and the symbols be accessed with the notation of ::hello() alone.


Written by Shlomi Fish