# Perl 5, 17 + 2 (-pl) = 19 bytes odd lines reversed $_=reverse if$.%2 even lines reversed $_=reverse if$|-- After @Martin's comment : input needs to have a trailing linefeed. [try it online][1] [1]: https://tio.run/##K0gtyjH9/18l3rYotSy1qDhVITNNRU/V6P//xCSu5BQurvQMrn/5BSWZ@XnF/3ULcgA