[Memphis.pm] perl discovery of the day

Big Ed dysan_2000 at hotmail.com
Mon Nov 27 16:39:45 CST 2000


Yup.  Any time you fork(), you choose the name of the forked process.  Same 
with a pipe();

Ed

>From: <perl at erd3.com>
>Reply-To: memphis-pm-list at pm.org
>To: memphis-pm-list at pm.org
>Subject: Re: [Memphis.pm] perl discovery of the day
>Date: Wed, 22 Nov 2000 01:45:17 -0600 (CST)
>
>
>
>On Tue, 21 Nov 2000, Carl Brock Sides wrote:
>
> > Did you know you can affect how your perl process appears in a "ps"
> > listing by writing to $0?
><snip>
>You can also do it in C.  I had a utility that required the password to be
>passed on the command line. It ran in the background like a daemon.  When
>you did a 'ps auwwx' the password was visable. I modified the program so
>that it set all of it's arguments to a zero byte string. No more password
>in ps. <grin>
>
> >
> > #/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__
>
>I know what the above code does, could you explain how it does it?
>
>
>Reece Dike
>
>
>----------------------------------------------------------------------------
>To unsubscribe, please send email to majordomo at pm.org
>with 'unsubscribe memphis-pm-list' in the body of the message.
>----------------------------------------------------------------------------
>

_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

----------------------------------------------------------------------------
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