On Wed, 12 Mar 2003, Iain 'Spoon' Truskett wrote: > Any chance of set_time_zone() being able to return $self? > > I just ask since it would make possible code such as: > > my $dt = DateTime->from_epoch( epoch => $then )->set_time_zone( $tz ); > > Rather than having to split it into two, less associated, lines.
There's nothing wrong with this, but if one method returns $self, then I'd say _all_ set methods should return it, so method chaining is possible, like: my $dt = DateTime->last_day_of_month( year => 2003, month => 3 )->add( days => 1 ); and other similar examples. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/
