http://qs321.pair.com?node_id=11126467


in reply to how can I get localtime without mutating any variables

Presuming your problem is that you don't want the pieces where you're now using $_ you'd either use undef in those locations, or use a slice and pull out just the ones you're actually interested in; e.g.

(undef, $min, $hr, $day, $mon, $year) = localtime(); ($min, $hr) = (localtime())[1,2];

You may also want to consider DateTime or Time::Piece to provide an object interface instead.

The cake is a lie.
The cake is a lie.
The cake is a lie.