in reply to Pass arguments

Only the shell knows about elements on the command line beyond any re-direction, so in the command line invocation
file.pl update directoryname/error.txt directoryname/filename.txt >& d +irectoryname/filename.log
, directoryname/filename.log is not (directly) accessible to the script.

Given that your script knows its own PID ($$), you may be able to parse it [the full command line] from the process tree e.g. by parsing the output from ps -fp $$...

A user level that continues to overstate my experience :-))