Hi all: I find out what I need from your replies, which is the "/e" at the end of substitution. I google on the web and it says evaluate the expression. that means I can transfer the pattern I got from string to scalar and do the addition. BTW, do you know where I can find the whole list after substitution and pattern matching, m/,?
appreciate your help, miloody 2008/7/6 Dr.Ruud <[EMAIL PROTECTED]>: > loody schreef: > >> I try to update the end of my file index by 1 per day. >> ex: >> file_0 --> file_1 >> file_10 --> file_11 > > I think you are looking for something like > > s/(?<=^file_)([0-9]+)$/$1+1/e > > > Example: > > $ echo -e 'file_0\nfile_10' | perl -wpe' > s/(?<=^file_)([0-9]+)$/$1+1/e > ' > file_1 > file_11 > > -- > Affijn, Ruud > > "Gewoon is een tijger." > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > http://learn.perl.org/ > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/