in reply to Re^2: Problem with renaming files in directory
in thread Problem with renaming files in directory

Using diagnostics reveals this info:
Insecure dependency in rename while running with -T switch at (F) You tried to do something that the tainting mechanism didn't l +ike. The tainting mechanism is turned on when you're running setuid or setgid, or when you specify -T to turn it on explicitly. The tainting mechanism labels all data that's derived directly or indi +rectly from the user, who is considered to be unworthy of your trust. If + any such data is used in a "dangerous" operation, you get this error. + See perlsec for more information. Uncaught exception from user code: Insecure dependency in rename while running with -T switch at
Since you are not explicitly using -T, look into setuid or setgid.

By the way, changing readdir to glob will not solve the double-digit filename issue.

Replies are listed 'Best First'.
Re^4: Problem with renaming files in directory
by ice_ice_ice (Initiate) on Jan 03, 2012 at 21:00 UTC
    So what should I do solve this double-digit filename issue ?:)

    I run this script as a root and I found that perl create those files with user id 200. I don't have user with this id. So for me is this strange. The group id for this file is the root, so everything is ok. If anyone know why I have user id 200 instead of 0 ?

      So what should I do solve this double-digit filename issue ?:)
      You already know how to grab the digits using a regex. Now you need to create an array of filenames and sort them numerically:
      perldoc -q sort
        Thanks toolic ;)

        do you know the why perl create new files with user id 200 ? The strange thing is that user with id 200 is not exists on system.