#!/usr/bin/perl -w use strict; my $string = 'ABCDEFGFEDCBA'; print "$string\n" and $string =~ s/$_/ /g for reverse 'A' .. 'G';