There's a reason I said Linux... :)
The problem is that setting $0 is not implemented for Solaris, at least not in a way that would work. AFAIK, that's because (a) there is no system support for it (in the form of setproctitle(), etc.), so you'd have to resort to manipulating argv[] directly at the C level, and (b) the normal tools like ps (i.e. /usr/bin/ps) or ptree don't read the command+args from argv[] anyway, but rather from some other, harder to manipulate location, so you'd have to use /usr/ucb/ps (whose output can - to some degree - be influenced by a modified argv[]).
In case I have the time later, I'll see whether I can whip up a little XS routine which would allow to change the command name as it's shown by /usr/ucb/ps...
In reply to Re^5: assigning a name to every threads
by almut
in thread assigning a name to every threads
by ajeet@perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |