in reply to Perl/Moose calling writer doesnt work
Update: As AnomalousMonk mentions below, I should have kept the original to remind me to read carefully before hitting submit ;)
So, here's the code I originally posted, using lazy to set the attribute based on information the class learns after it's created:
has FileName => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build_filename', ); sub _build_filename { my $self = shift; # build logic here return $filename; }
In Section
Seekers of Perl Wisdom