in reply to System Command mv not working - Require a solution without modules.

The filenames have newlines at the end. If you had used the Perl built-in rename function, it would have told you that your filenames have newlines at the end.

  • Comment on Re: System Command mv not working - Require a solution without modules.

Replies are listed 'Best First'.
Re^2: System Command mv not working - Require a solution without modules.
by G Nagasri Varma (Novice) on Jan 28, 2016 at 08:47 UTC
    I tried chomp function "chomp($lines$i);" but it throws me the error Illegal division by zero at ./data.pl line 13, <DATA> line 3.

      Please post the relevant code and please use <code>...</code> tags to mark it so it renders and downloads nicely.

      The problem is mostly a syntax error in your code where Perl interprets a file path as a division of two values. This mostly happens when you omit a closing quote on a string.