#!/usr/local/bin/perl
#title "Wish I could include global constants"
#CheeseSpread.pl
use strict;
use warnings;
package CheeseSpread;
BEGIN{
our $name = "Mary";
our $monkish = "MaryFranan";
}
1;
####
#!/usr/local/bin/perl
use strict;
use warnings;
require 'CheeseSpread.pl' #imports the package symbol table;
print name();
print monkish();
sub name{
return "my name is $CheeseSpread::name\n";
}
sub monkish {
return "my avatar is $CheeseSpread::monkish\n";
}
print "-" x 50, "\n"; # a horizontal rule
my $firstName = $CheeseSpread::name;
my $monasteryName = $CheeseSpread::monkish;
print "my name is $firstName\n";
print "my avatar is $monasteryName\n";
1;
####
%h2xs -X -A -n Name::Module
####