"be consistent" | |
PerlMonks |
Re^3: Perl/Moose calling writer doesnt workby duelafn (Parson) |
on Mar 10, 2018 at 18:48 UTC ( [id://1210631]=note: print w/replies, xml ) | Need Help?? |
It looks like your current code can be used just by removing the writer parameter. It looks, to me, like you are making some checks in SetFileName and then set the parameter using the standard accessor. Thus, something like this should work for you:
Though normally, if you want to force use of a custom writer you would change the default writer to start with an underscore to indicate that it should be treated as a private method (Note: treating underscore methods as private is a convention, it is not enforced):
Also note that your custom SetFileName will not be called if FileName is passed to new(). For that you would have to do something in BUILD or else some of the other special methods or such. Good Day,
In Section
Seekers of Perl Wisdom
|
|