in reply to Re^2: print question
in thread print question

So when it sees the % in the varible $rc followed by the / of the directory it says "Error"

Nothing you showed looks at what's in $rc except print, and print does not treat % specially. From what you told us, your diagnosis is incorrect.

You could get that error if the contents of the file you write to is used as a printf format string by something else.