in reply to system call error

  1. Print out the value of $elf_files[7] to determine if it has what you expect (See Basic Debugging Checklist)
  2. Consider some form of glob rather than shelling out to ls
  3. Consider extracting the last field in the line within Perl instead of piping to awk. That will remove the need for $NF = '$NF'; or equivalents.