There are proper system calls and perl modules to deal with proc filesystem. Generally not a good idea to be playing in there with directory commands. Files in there have some magick attributes and appear and dissappear suddenly.
The inner workings of /proc is different between systems.
the hardest line to type correctly is: stty erase ^H