[Memphis.pm] perl discovery of the day

Carl Brock Sides csides at autozone.com
Tue Nov 21 15:20:37 CST 2000


Did you know you can affect how your perl process appears in a "ps"
listing by writing to $0?

csides at tanuki:~$ perl -e '$0 = "magic proctitle"; while(1){1}' &
[1] 22279
csides at tanuki:~$ ps -ef | grep magic
csides   22279 15033 96 15:17 pts/4    00:00:03 magic proctitle
csides   22282 15033  0 15:17 pts/4    00:00:00 grep magic

-- 
Brock Sides
csides at autozone.com

#/usr/bin/perl
#.: .|-| ::||-| .||-:: ::|||-| :|-. :||-:: .:-| |-| 0-| .-| |||
#0 ||-:: ::|||-| |||-| |-| 0-| .-| |||-.: ::-:: :|||-| :|||
#| .|||-| .||-.| :-| .||-| ||-| .-: .|-:: ::|||-| .||-| ::|
open(Q,$0);while(<Q>){if(/^#(.*)$/){for(split('-',$1)){$q=0;$qq=0;
for(split){s/\|/:.:/g;s/:/../g;$Q=$_?length:$_;$q+=$qq?$Q:$Q*20;
$qq++;}print chr($q);}}}print"\n";
__END__
----------------------------------------------------------------------------
To unsubscribe, please send email to majordomo at pm.org
with 'unsubscribe memphis-pm-list' in the body of the message.
----------------------------------------------------------------------------




More information about the Memphis-pm mailing list