http://www.perlmonks.org?node_id=360872


in reply to Tic tac toe

Can anyone come up with a shorter one?
Only 4 years late, but yes:
@r=(123,456,789,147,258,369,159,357);$,=$/;$p=X; sub d{print@r[0..2],$p;die$_[0]if@_} n:d;$m=<>until grep$m=~/\d/&&s/$&/$p/,@r; d"Tie"if!map/\d/,@r;d$p if map/$p{3}/,@r; $p=~tr/XO/OX/;goto n
190 characters.