>>187 Perl5

use Time::Piece;
use Time::Seconds;
for (qw{00:00:00 23:59:59}) {
 $t = Time::Piece->strptime($_, '%T') + 1;
 print "入力:$_\n出力:", $t->strftime('%T'), "\n";
}

※見易くするためインデントを全角スペースに置換してあります


実行結果
~ $ perl 22_187_1秒後.pl
入力:00:00:00
出力:00:00:01
入力:23:59:59
出力:00:00:00