Help for this page

Select Code to Download


  1. or download this
    # Foo.pm
    
    ...
    print 'from package ', __PACKAGE__, " during use: '$hello' \n";
    
    1;
    
  2. or download this
    # use_foo_1.pl
    
    ...
    hello('test');
    
    print 'from package ', __PACKAGE__, " during execution: '", get_hello,
    + "' \n";
    
  3. or download this
    c:\@Work\Perl\monks\Anonymous Monk\1207065>perl use_foo_1.pl
    from package Foo during use: 'evaluated during module inclusion'
    from package main during execution: 'evaluated during module inclusion
    +'
    
  4. or download this
    # Foo.pm
    
    ...
    print 'from package ', __PACKAGE__, " during use: '$hello' \n";
    
    1;
    
  5. or download this
    # use_foo_2.pl
    
    ...
    
    printf "B: from package %s during execution: '%s' \n",
        __PACKAGE__, get_hello;
    
  6. or download this
    c:\@Work\Perl\monks\Anonymous Monk\1207065>perl use_foo_2.pl
    from package Foo during use: 'evaluated during module inclusion'
    A: from package main during execution: 'evaluated during module inclus
    +ion'
    B: from package main during execution: 'now we're getting somewhere!'