Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: process table

by roboticus (Chancellor)
on Dec 20, 2013 at 19:48 UTC ( #1067985=note: print w/replies, xml ) Need Help??


in reply to process table

teamassociated:

Because you have two CPUs, and a hash holds one item. So the last one read wins for each CPU. Try this to get a hash of arrays (HoA):

push @{$prochash{$cpu}}, { 'pid' => $pid, 'time' => $time, 'user' => $user, 'args' => $args, };

Or if you want a hash of hashes (HoH), use the first level for the CPU and the second for the PID:

$prochash{$cpu}{$pid} = { 'pid' => $pid, 'time' => $time, 'user' => $user, 'args' => $args, };

There are other ways to do it, too. You may want to review perldoc perldsc

Update: Changed language a little to clarify.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1067985]
help
Chatterbox?
[choroba]: Doesn't vertical bar work in MSWin?
[RonW]: Why not ytdl >data then ffmpeg <data ?
[RonW]: (I use Windows as little as possible)
[LanX]: RonW: yes I think something like inline::Rperl would be great, but Will is AFAIK not interested to go that way
[james28909]: well now i am using a for /f delims= %i IN(yt-dl) do set var=%i & ffmpeg -i "%var%" -a:c mp3 output.mp3 & set var=
[james28909]: just to get around not being able to do yt-dl | ffmpeg
[james28909]: learning is fun ISNT IT?!?!!??

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2017-05-22 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?