You should read Coping with Scoping by MJD.
perldoc perlmod would also be useful reading.
The code is out of this world ugly. It tramples on all sorts of namespaces without a concern in the world just because the author seems to think $author::email is cool.
A better way would have been to use a hash:
my %author = (
email => '[email protected]',
...
);
Trampling all over the symbol table is not necessary.
I do have a few Win32::OLE
examples: http://www.unur.com/comp/ which are no works of art but I believe are improvements on this style. See also http://stackoverflow.com/questions/820348/why-are-the-number-of-pages-in-a-word-document-different-in-perl-and-word-vba/821569#821569
I am going to rant a little:
@pgm::runtime_args = @ARGV ;
So, we give up on the standard @ARGV
array to trample on the pgm
namespace. Not only that, every Perl programmer knows what @ARGV
is. In any case, @pgm::runtime_args
is not used again in the script.
$pgm::maxargs = $#pgm::runtime_args + 1 ;
Of course @pgm::runtime_args
in scalar context would give us the number of elements in that array. I have no idea why $pgm::maxargs
might be needed, but if it were, then this line should have been:
$pgm::maxargs = @pgm::runtime_args;
I am not going quote more of this stuff. I guess this is what happens when Cobol programmers try to write Perl.
$program::copyright = "Copyright (c) 02002 - Kenneth Tomiak : All rights reserved.";
I am glad he allocated five digits for the year. Ya never know!
PS: I believe my excerpts constitute fair use.