#!/usr/bin/perl -w # -*-Perl-*- use strict; sub zaxo { my ($str,$chr,$new,$nbr)=@_; $str=~s/$chr/(--$nbr>0)?$chr:$new/geo; $str; } my $s = "Terence and Philip are sweet\n"; my $c = 'e'; my $r = 1; my $n = 3; print zaxo( $s,$c,$r,$n); exit;