[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] $0 = "I am not running";



Fascinating. When you set $0 inside a running Perl program, "ps w" and "ps -ef" and some others will report whatever you set. But "ps" won't change...

j


$ perl -e '$0 = "I am not running"; sleep 10' &
$ ps
  PID TTY          TIME CMD
11323 pts/0    00:00:00 bash
11631 pts/0    00:00:00 perl
11656 pts/0    00:00:00 ps
$ ps w
  PID TTY      STAT   TIME COMMAND
11323 pts/0    S      0:00 -bash
11631 pts/0    S      0:00 I am not running
11657 pts/0    R+     0:00 ps w