#!/usr/bin/perl use strict; my $find = "r"; my $replace = "X"; my $input = "superfrink"; my $tmp = reverse $input; $tmp =~ s/$find/$replace/; my $output = reverse $tmp; print "input: $input \n"; print "output: $output \n";