Thanks to both of you.When i tried to print out @cmd, It was printing them out, but I can't understand why, was not substituting the actual values of $file.Since I din't have an actual file called $file, it was trowing me an error.Once I changed it as @ options etc, it succeeds, atleast from my side.I just need to go on to the as400 to see if it has recieved the files
Comment on Re: system commands aren't working as a loop.
The key difference is moving $file outside of qw() because qw() doesn't interpolate. Creating an array of options instead of one containing the whole command is just aesthetics. It all results in the same list of arguments.