ttys = ( ); open(WHO, "who|") or die "can't open who: $!"; while () { ($user, $tty) = split; push( @{$ttys{$user}}, $tty ); } foreach $user (sort keys %ttys) { print "$user: @{$ttys{$user}}\n"; } The heart #### #!/usr/bin/perl -w use strict; open FH, 'sipfile.m' or die "can't open file $!"; my ($call1, $sipm); my %data1 = ( ); while () { if (($call1,$sipm) = /(SIP[0-9]).+ (\d\d\d).+$/) { push ( @{data1{$call1}}, $sipm ); } } foreach $call1 (sort keys %data1) { print "$data1{$call1}\n"; } close FH; #### Scalar value @{data1{$call1} better written as ${data1{$call1} at ./perl.m line 12.
Type of arg 1 to push must be array (not hash slice) at ./perl.m line 12, near "$sipm )" Execution of ./perl.m aborted due to compilation errors.