in reply to print copy source and destination

Do you mean:

print "Source: $source. Target: $targetdir1\n";

Perl reduces RSI - it saves typing

Replies are listed 'Best First'.
Re^2: print copy source and destination
by drodinthe559 (Monk) on Oct 01, 2008 at 23:05 UTC
    I thought there is a way to put the print command directly into the copy command, but I could be wrong. I thought someone should me how to do that.

      What do you actually want printed? Print and copy are orthogonal operations - I don't understand how it makes sense to "put the print command directly into the copy command" unless you mean to modify the copy sub to print its parameters.

      if you want a modified copy sub you could:

      sub myCopy { my ($source, $target) = @_; print "Copying from $source to $target\n"); return © }

      Perl reduces RSI - it saves typing
        If you want an "invisible" wrapper (useful for instance if the 'copy' function uses Carp), replace the 'return' by 'goto'.