in reply to I cannot create backup copy during file name change

The following are just a few elements that trouble my understanding:

Update: removed stupid comment; added below para on use of rename

Update2: jethro holds -- with good reason, ++ -- that the 'stupid remark' is the observation that _oldname_ can't match. He's right; I should have allowed for cases in the sort of format OP has now described, below; however, OP's use of glob "*.txt" would never find the .pdf files asserted in Re^2: I cannot create backup copy during file name change.
FTR, the point was not to make OP look foolish; rather, it is that one should cut'n'paste (double-checked) code into PM nodes, to avoid such goofs, rather than risk the hazards of retyping something that already exists in digital form.
(...and, BTW, the remark removed was even stupider)

Also, perldoc -f rename tells us

rename OLDNAME,NEWNAME
        Changes the name of a file; an existing file NEWNAME will be
        clobbered. Returns true for success, false otherwise.
        Behavior of this function varies wildly depending on your system
        implementation. For example, it will usually not work across...
which is (IMO) very nearly a deprecation message.

Replies are listed 'Best First'.
Re^2: I cannot create backup copy during file name change
by jethro (Monsignor) on Jul 24, 2012 at 16:31 UTC

    I think "bla_oldname_bla.txt" would match the regex quite well

Re^2: I cannot create backup copy during file name change
by rnaeye (Friar) on Jul 24, 2012 at 16:33 UTC
    Hi ww ;

    My files are named as below:

    someText_oldname_someText.pdf

    , and I wanted to change them to something as below:

    someText_newname_someText.pdf

    My intention was to change the text between underscores (_ … _), but not touch the rest of the file name.

    Thanks.
      And how does glob "*.txt" find files with a "pdf" extension?
        I meant  glob "*.pdf"