Hi Lars, some comments on your code:
On Fri, 11 Mar 2016 20:22:34 +0200 Lars Noodén <lars.noo...@gmail.com> wrote: > If I have the code below to fork a child process, how would the right > way be to fork as a different user? I gather that fork() itself does > not support that, so some other method must be used. > > Regards, > Lars > > ----- > > #!/usr/bin/perl > > use strict; > use warnings; > use English; # for $UID and such > See http://perl-begin.org/tutorials/bad-elements/#non_recommended_regex_vars . > my $old_uid = $UID; > > $UID = 1000; > > my $pid = fork(); > > unless( $pid ){ > print qq(\tThis is a child process, PID $$\n); > print qq(\tThe child UID is $UID \n); Here you output trailing whitespace: http://perl-begin.org/tutorials/bad-elements/#trailing-whitespace Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Star Trek: “We, the Living Dead” - http://shlom.in/st-wtld I may be a geek, but I’m a true Klingon geek‐warrior! And a true Klingon geek warrior ALWAYS bottom‐posts. Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/