in reply to copying files from cgi perl script is modifying target file permissions

What does cp-f do? It is not a standard command.

Also note that system returns the exit status, so normally you should use system "..." and die instead of or.

Replies are listed 'Best First'.
Re^2: copying files from cgi perl script is modifying target file permissions
by taint (Chaplain) on Jun 20, 2012 at 18:25 UTC
    taint% man cp 1
    CP(1) FreeBSD General Commands Manual CP(1) ... -f For each existing destination pathname, remove it and create a new file, without prompting for confirmation regardless of its permis- sions. (The -f option overrides any previous -i or -n options.)

    I this this option may have led to your problem.

    use perl::always;
    my $perl_version( 5.12.4 );
    print $perl_version;
      taint% man cp 1

      Nice. But "cp-f" ne "cp", and "cp-f" ne "cp -f".

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)