#!/usr/bin/perl # # ./boustrophedon.pl file # # From a discuussion on the dc-stuff mailing list a few years back # about being able to reverse every other line. # # Here is the result. Easy, yes. # while (<>) { $i++; chomp; if ($i % 2 == 0) { $data = reverse $_; print "$data\n"; } else { print "$_\n"; } }