Help for this page

Select Code to Download


  1. or download this
    $ cat MyClass.pm
    
  2. or download this
    use strict;
    use warnings;
    ...
    };
    
    1;
    
  3. or download this
    $ cat script.pl
    
  4. or download this
    use lib '.';
    use MyClass;
    ...
    $bar = foo;
    
    print "$bar\n";
    
  5. or download this
    $ perl script.pl
    
  6. or download this
    42
    
  7. or download this
    $ cat MyClass2.pm
    
  8. or download this
    use strict;
    use warnings;
    ...
    };
    
    1;
    
  9. or download this
    $ cat script2.pl
    
  10. or download this
    use lib '.';
    use MyClass2;
    ...
    $bar = foo;
    
    print "$bar\n";
    
  11. or download this
    $ perl script2.pl
    
  12. or download this
    Global symbol "$bar" requires explicit package name (did you forget to
    + declare "my $bar"?) at script2.pl line 4.
    Global symbol "$bar" requires explicit package name (did you forget to
    + declare "my $bar"?) at script2.pl line 6.
    Execution of script2.pl aborted due to compilation errors.