On Fri Feb 13 15:40:38 2015, LeonT wrote: > On Mon, Feb 9, 2015 at 10:56 PM, via RT <perlbug-followup@perl.org> > wrote: > > > The original problem which led me to this was: > > > > system "ps","-p",$$,"-o","pid,etime,bsdtime,c,rss"; # always shows > > wrong values > > > > The problem appears to be that $$ is not correct when passed to > > system(). > > I'm guessing it evaluates to the pid of an internaly-created child > > process. > > > > Can 'system' (and any other forking operators) be made to > > evaluate their arguments *before* forking? > > > > #!/usr/bin/perl > > use strict; use warnings; > > > > my $copy_of_pid = $$; > > print "Perl process is $$\n"; > > > > system "/bin/echo", 'echo: $$ =', $$; > > system "/bin/echo", 'echo: $copy_of_pid =', $copy_of_pid; > > > > Fix attached. > > Leon In the parts of the patch where you are adding lines to source code or tests, could you use space characters rather than hard-tabs for leading whitespace, so as to make the appearance tidier? Thank you very much. -- James E Keenan (jkeenan@cpan.org) --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=123775Thread Previous | Thread Next