in reply to change the end of a path inside file

sub dec {return(shift)-1}; $path =~ s/(\d+)$/dec($1)/e;
will change path the way you want, be sure to copy the value before doing this so your system call has access to both values. You may also want to check for success, in case filenames do not end in digits.

thanks to ferrency for the /e tip.

Replies are listed 'Best First'.
Re: Re: change the end of a path inside file
by DS (Acolyte) on Jul 17, 2002 at 19:29 UTC
    thank you all ,, ;) nice one