<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Marco Balestra ha scritto:
<blockquote cite="mid03B07009-B4DB-4C6C-96FB-4605875D1396@cesmail.net"
type="cite">
<pre wrap="">On 17/apr/07, at 19:48, LordOfDeath wrote:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">ad ogni occorrenza setto $hash{$chiave}++, alla fine ho sia
l'elenco senza ripetizioni (keys %hash) che le numerosità di ogni
singola occorrenza.
</pre>
</blockquote>
<pre wrap="">potresti farmi un esempio per favore? grazie in anticipo
</pre>
</blockquote>
<pre wrap=""><!---->
my @procs = `ps aux`;
my %PS;
foreach my $line (@procs){
        chomp $line;
        $line =~ s/ [0-9].+$//;
        $line =~ s/USER.+COMMAND//;
        $PS{$line}++ if $line;
}
A questo punto puoi usare %PS, ad esempio:
foreach my $k (sort keys %PS) {
        print "$k is here $PS{$k} times\n";
}
</pre>
</blockquote>
grazie mille :) e grazie a tutti quelli che mi hanno aiutato :)<br>
</body>
</html>