Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Prepend a Moose attribute when changed

by Haarg (Priest)
on Feb 08, 2019 at 13:19 UTC ( [id://1229611]=note: print w/replies, xml ) Need Help??


in reply to Prepend a Moose attribute when changed

It may make more sense to prepend the extra string in your accessor.
package Test; use Moose; my $prepend = '/some_string/'; has appended => (is => 'rw'); around appended => sub { my ($orig, $self) = (shift, shift); my $value = $self->$orig(@_); return $prepend . $value; }; 1;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1229611]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2024-04-18 12:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found