# The lines from here to the =cut are part of Perl's
# internal documentation system.  If you want 
# view the documentation use the command:
#
#	pod2text <script>
#
=pod

=head1 NAME

ex.pl - Code example.

=head1 DESCRIPTION

Does nothing, but is a code example.

=head1 AUTHOR

Steve Oualline, E<lt>oualline@www.oualline.comE<gt>.

=head1 COPYRIGHT

Copyright 2002 Steve Oualline.
This program is distributed under the GPL.  

=cut
# Note: This example is artificial
# Most of the time packages are in 
# separate files.
use strict;
use warnings;

my $calling = 0;    # Are we calling
                    # (Defines $main::calling)
package call;

my $in_call = 0;    # Are we in a call
                    # (Defines variable $call::in_call)

# Subroutine call::start()
sub start() {
    $in_call = 1;    # We are calling
                     # (Uses $call::in_call)
}

package main;        # We are the main program

$calling = 1;        # We are calling
start();             # ERROR: No main::start();
call::start();       # OK, calls the correct start
