|Problems? Is your data what you think it is?|
Re: new() function: incorrect?by fmerges (Chaplain)
|on Nov 12, 2008 at 09:53 UTC||Need Help??|
Well in itself it's nothing wrong with it, it creates an object...
A couple of thinks can be mentioned like, there are people that don't like to have the possibility to instantiate a new object by calling an object see ref ||. Other things are more a style question... you don't need to have the bless and the return on two different lines. Maybe they didn't like the command => undef without the leading ',' to avoid errors when you add something and forget the comma...
Another thing could be that you could skip the whole constructor even by using some sort of module, like Class::Accessor for example. The 'use warnings' pragma could be there, even commented it looks good...
But it looks more that they evaluated overall your coding practices by this example... maybe to much BPP, who knows... I would rather look on a longer piece of code, with some algorithm, see if you know also to write tests, etc, etc.
fmerges at irc.freenode.net