[Catalyst] Re: Mason view hackers (and other views), PING
A. Pagaltzis
pagaltzis at gmx.de
Sat May 19 21:23:21 GMT 2007
Hi Matt,
* Matt S Trout <dbix-class at trout.me.uk> [2007-05-19 21:15]:
> On Sat, May 19, 2007 at 07:55:15PM +0200, A. Pagaltzis wrote:
> > * Matt S Trout <dbix-class at trout.me.uk> [2007-05-19 19:45]:
> > > comp_root => do { my $root = $c->config->{root}; "${root}"; },
> > >
> > > would be better, I think.
> >
> > Why `do`? Wouldn’t this be just as good?
> >
> > comp_root => "" . $c->config->{root},
>
> Yes, but IMO less explicit.
I don’t see any difference. Both rely on the reader knowing that
a particular operation implicitly stringifies, whether that is
concatenation or interpolation
Explicit would be something like
comp_root => map { eval { $_->stringify } or $_ } $c->config->{root},
--
*AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1}
&Just->another->Perl->hack;
#Aristotle
More information about the Catalyst
mailing list