Broken Mac::Processes ... Help?

pudge on 2007-04-09T15:49:45

If you can, please try this script out, using the latest Mac::Carbon (0.77). Especially on Intel.

#!/usr/bin/perl -w

use Mac::Processes;

while ( ($psn, $psi) = each(%Process) ) { print $psi->processName, ' ' if $psi; print "$psn\n"; }


Let me know what platform you are using, and if the script terminates (as opposed to it just printing the same $psn forever (have your ctrl-C ready!)).


Fine for me

brian_d_foy on 2007-04-09T17:13:49

Works for me:

$ uname -a
Darwin macbookpro.local 8.8.2 Darwin Kernel Version 8.8.2: Thu Sep 28 20:43:26 PDT 2006; root:xnu-792.14.14.obj~1/RELEASE_I386 i386 i386

Need more than 1?

sigzero on 2007-04-09T17:16:56

I can do this when I get home if you would like another confirmation.

Re:Need more than 1?

pudge on 2007-04-09T17:41:05

Yeah, anyone.

What happens...

jk2addict on 2007-04-09T19:34:50

Now, I'm no purl guru, but I seem to recall there being some oddness with each(), certain versions of perl, and tied hashes.

What happens if you use keys() instead?

Re:What happens...

pudge on 2007-04-09T19:50:10

No difference.

Works fine for me...

sigzero on 2007-04-09T21:15:52

[robert]$ uname -a
Darwin Excelsior.local 8.9.1 Darwin Kernel Version 8.9.1: Thu Feb 22 20:55:00 PST 2007; root:xnu-792.18.15~1/RELEASE_I386 i386 i386