use strict; use warnings; open my $fh, "<", "zones.txt"; my @lines = <$fh>; close $fh; for (@lines) { chomp $_; my @F = split /\./, $_; print join ('.', reverse @F) . "\n" }