1
1172948251
I want to maintain my $version variable in a single place
within the script and I want it available in a BEGIN block
that is a different package from the rest of the script. Is
this possible? Here's what I mean:
---------------
#!/usr/bin/perl
BEGIN {
package Some:ackage;
my $version = '1';
print "version is $version\n";
}
my $version = $Some:ackage::version;
print ("version is $version\n"); # not initialized ???
within the script and I want it available in a BEGIN block
that is a different package from the rest of the script. Is
this possible? Here's what I mean:
---------------
#!/usr/bin/perl
BEGIN {
package Some:ackage;
my $version = '1';
print "version is $version\n";
}
my $version = $Some:ackage::version;
print ("version is $version\n"); # not initialized ???