in reply to FInd and permission change

You get this message because $3 and $1 are uninitialized in line 3.

Unlike shell programming, in Perl single quotes don't protect anything inside double quotes.

I wonder why anyone would want to call awk from perl, though; either language would do this job easily by itself.