#!/usr/bin/perl use strict; use warnings; my $string = 'www.perlmonks.org.split.reduce.code.check'; my @array = (); @array = split /\./, $string; @array = reverse @array; print "Reversed data ==> @array\n";