madtoperl has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,
I am trying to reverse a string based on dot symbol and print the result. Below code is working fine. Do we have more efficient way of reducing the lines of code. Probably an one liner, please share your thoughts/a better version of code..
#!/usr/bin/perl use strict; use warnings; my $string = ''; my @array = (); @array = split /\./, $string; @array = reverse @array; print "Reversed data ==> @array\n";