Thank you for replying...
The thing that confused me initially was that system() was returning a non zero number - namely 256 which from reading about system() really means 1 so I thought by checking what the value of $! was that would tell me what errno 1 is. If that is not the case then how do I figure out what errno 1 is? and is it possible for you to tell why that kind of error might be happening?