Subject: | Typo in perldoc relating to :default ATTR |
Hello,
There is a minor typo in the perldoc in Std.pm from Class::Std version 0.0.4. I hesitate to mention something so small, but looking at the example code did cause some confusion and time spent figuring out what was wrong.
At line 1435 of of Std.pm I see:
my %seen_of :ATTR( :default(0) );
Which should be:
my %seen_of :ATTR( :default<0> );
And again at line 1442 of Std.pm we have:
my %customers_of :ATTR( :default([]) );
Which should be:
my %customers_of :ATTR( :default<[]> );
Following the incorrect examples in the documentation leads to errors such as:
Missing initializer label for Oracle::DevObjects: 'foobar'.
Fatal error in constructor call at test.pl line 11
when defining attributes (incorrectly, as in the perldoc example) like:
my %foobar_of : ATTR(:init_arg<foobar> :default([0,1,2,3,4]) );
Discovering the cause of the above 'Missing initializer label' error is particularly tricky because it only seems to pop up when you're calling new() without a hash ref of arguments.
Thanks,
- jeff -