Time-UTC

 view release on metacpan or  search on metacpan

lib/Time/UTC.pm  view on Meta::CPAN

is called for each segment of the UTC description in turn, passing the
segment as an argument to the function.  This call takes place, for each
segment, when it is complete, as described in L<Time::UTC::Segment>.
The function is immediately called for already-complete segments.

To do this for only one segment, see the C<when_complete> method on
C<Time::UTC::Segment>.

=cut

sub foreach_utc_segment_when_complete(&) {
	my($what) = @_;
	my $setup_for_segment;
	$setup_for_segment = sub($) {
		my($seg) = @_;
		$seg->when_complete(sub() {
			eval { local $SIG{__DIE__}; $what->($seg); };
			$setup_for_segment->($seg->next);
		});
	};
	$setup_for_segment->(utc_start_segment());



( run in 0.826 second using v1.01-cache-2.11-cpan-49f99fa48dc )