#!/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";
frink@scanbox:~ $ ./397370.pl input: superfrink output: superfXink frink@scanbox:~ $
In reply to Re^2: Replace the last letter
by superfrink
in thread Replace the last letter
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |