in reply to system call error

This is definitely one of those cases where all of the advice from here and here applies: First, don't do things like ls and awk in the shell, do them in Perl. For example, instead of ls, the module Path::Class is very nice. And for calling the readelf command, you should use one of the modules I suggest in the first link - such as IPC::System::Simple's capturex, or, if you also need to capture the command's STDERR, maybe IPC::Run3. There is example code for both in the first link.