The package declarations themselves are not too exciting since, as you can see below, the package can be referenced in other packages. However, notice for a variable declared with our it doesn't matter whether you put the package-in-the-block before or after the normal one, the use of the unqualified variable will default to the one outside of the block.
#!/usr/bin/perl -w
use strict;
{
package niceThing;
our $compat = 4234;
sub howdy {
return qq|Howdy in package niceThing!|;
}
}
package nonNiceThing;
our $compat = 4555;
sub howdy {
return qq|Howdy in package nonNiceThing!|;
}
package main;
print niceThing::howdy();
print nonNiceThing::howdy();
print "\n$compat\n";
print "\n$niceThing::compat\n";
Result:
Howdy in package niceThing!Howdy in package nonNiceThing!
4555
4234
This works even if you take the package name out of the enclosed block so my suspicion is that in the code you are looking at the package declaration was put into the block for convenience and readability.
Celebrate Intellectual Diversity