in reply to One liner help

What happens with

perl -lpe "join q{.}, reverse split /\./" zones.txt
You could also
perl -F. -lpe "join q{.}, reverse @F" zones.txt
but I was never a fan of -a.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: One liner help
by VinsWorldcom (Prior) on Oct 08, 2014 at 19:53 UTC

    Thanks, but neither of these work for me (Windows 7 x64 / Strawberry Perl v5.18.1 MSWin32-x64-multi-thread):

    VinsWorldcom@C:\Users\VinsWorldcom\tmp> perl -lpe "join q{.}, reverse +split /\./" zones.txt 1.100.10 2.100.10 3.100.10

    They both just seem to print the file as-is.

      Stupid mistake; sorry:
      perl -lpe "$_=join q{.}, reverse split /\./" zones.txt

      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

        BINGO!