Help for this page

Select Code to Download


  1. or download this
    # XYZ.pm
    package XYZ;
    ...
    use constant CONST => 10.10;
    
    1;
    
  2. or download this
    # example.pl
    use strict;
    ...
    require XYZ;
    print "PI=".$XYZ::PI."\n";
    print "CONST=".XYZ::CONST."\n";
    
  3. or download this
    Bareword "XYZ::CONST" not allowed while "strict subs" in use at exampl
    +e.pl line 13.
    Execution of example.pl aborted due to compilation errors.
    
  4. or download this
    Name "XYZ::PI" used only once: possible typo at example.pl line 11.
    PI=3.14