Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

howto list running processes with Perl?
please help.
i need to list running processes with Perl, any suggestions?
many thanx
clint

Report this thread to moderator Post Follow-up to this message
Old Post
clint
04-19-05 08:56 PM


Re: howto list running processes with Perl?
On Tue, 19 Apr 2005 16:17:52 +0000, clint wrote:

> please help.
> i need to list running processes with Perl, any suggestions?
> many thanx
> clint

sorry i mean howto count them!
thanx
clint


Report this thread to moderator Post Follow-up to this message
Old Post
clint
04-19-05 08:56 PM


Re: howto list running processes with Perl?
clint wrote:

> On Tue, 19 Apr 2005 16:17:52 +0000, clint wrote:
> 
>
> sorry i mean howto count them!
> thanx
> clint

A rude approach would be to use backticks:

my @proc = `ps -ax`;
my $cnt = $#proc;
print "Running processes: $cnt\n";

But while where already spawning a process, why not spawn 2 and save a line
of code:

my $cnt = `ps -ax | wc -l` + 0;
print "Running processes: $cnt\n";

LLAP & LG
Rene

Report this thread to moderator Post Follow-up to this message
Old Post
Rene Schickbauer
04-20-05 08:56 AM


Re: howto list running processes with Perl?
For windows you can  use the Win32_Process of wmi , or for faster execution
use the Win::API module to call the psapi.dll



Report this thread to moderator Post Follow-up to this message
Old Post
George Bouras
04-20-05 08:56 PM


Re: howto list running processes with Perl?
Rene Schickbauer wrote:
> clint wrote:
>
> 
>
>
> A rude approach would be to use backticks:
>
> my @proc = `ps -ax`;
> my $cnt = $#proc;
> print "Running processes: $cnt\n";
>
> But while where already spawning a process, why not spawn 2 and save a lin
e
> of code:
>
> my $cnt = `ps -ax | wc -l` + 0;
> print "Running processes: $cnt\n";
>
> LLAP & LG
> Rene

why not just

print `ps -ef | wc -l`;

Eric

Report this thread to moderator Post Follow-up to this message
Old Post
Eric Teuber
04-22-05 01:55 AM


Re: howto list running processes with Perl?
clint <clint@freemail.hu> writes:

> please help.
> i need to list running processes with Perl, any suggestions?
> many thanx
> clint

On what platform - windows, mac, linux?

Tim
--
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you
really need to send mail, you should be able to work it out!

Report this thread to moderator Post Follow-up to this message
Old Post
Tim X
05-05-05 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:16 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.