<?xml version="1.0" encoding="windows-1252"?>
<node id="182556" title="Re: change the end of a path inside file" created="2002-07-17 15:10:59" updated="2005-03-19 02:14:12">
<type id="11">
note</type>
<author id="45391">
ichimunki</author>
<data>
<field name="doctext">
&lt;code&gt;
sub dec {return(shift)-1};
$path =~ s/(\d+)$/dec($1)/e;
&lt;/code&gt;
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.
&lt;p&gt;
thanks to [ferrency] for the /e tip.</field>
<field name="root_node">
182553</field>
<field name="parent_node">
182553</field>
</data>
</node>
