in reply to File name is long to copy

Your problem is almost certainly Windows. You will need to work around some Microsoft dain bramage by changing to the source directory, opening the source file using a relative filename, changing to the target directory, opening the target file using a relative filename, and then copying the file contents. Note that you may have to change directories in steps (chdir('C:\sandboxes\source_backup\source_backup\source_develop') && chdir('.\source_folder\source_part\source_specific') && chdir('.\source_common') or die "chdir: $!"; is one possibility) if the directories are themselves deeply nested with long names, or use UNC paths for source and target, which are either exempt from path length limits or have higher limits — I do not know which.

Replies are listed 'Best First'.
Re^2: File name is long to copy
by syphilis (Archbishop) on Apr 28, 2020 at 07:31 UTC
    Your problem is almost certainly Windows

    I think the problem is almost certainly a typo - but only because, having replicated the OP's file structure (as specified by his code), I can find no problem with it on Windows 7.
    OP's script works fine for me, as is.

    Either way, it would be interesting to know precisely which it is, but I'm not confident that we'll find out.

    Cheers,
    Rob

      The example paths in OP's code look sanitized to me and I suspect that the real file names are much longer. I have had these kinds of errors occur at $WORK with mapped network drives in the past and the solution I used then was to simply map another drive letter to a subfolder and access the deeply nested directories that way.