I wonder if instead of
my $obj = My::Class->new()->foo("foo")->bar("bar");you couldn't do
my $obj = My::Class->new({ foo => 'foo', bar => 'bar'});That would make things a little more clear than trying to decipher the layers of arrows. And you could also punctuate it differently ..
my $obj = My::Class->new({ foo => 'foo', bar => 'bar' });
.. depending on your taste.
In reply to Re: Method Chaining and Accessors
by talexb
in thread Method Chaining and Accessors
by linenoise
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |