in reply to Re^2: How to change process title ?
in thread How to change process title ?
Whatever, I don't know about other unices, but under Linux I guess that programs like ps just check /proc/$pid/cmdline, and I doubt (but I'm far from being sure!) that there are other ways to recover the same info.
Now, as of my experiment of yesterday, it seems that at least with recent enough perls and kernels (5.8.7 and 2.6.13 respectively, here) assigning to $0 actually writes into /proc/self/cmdline:
$ perl -le '$0="foo"; print <>' /proc/self/cmdline foo
|
|---|