Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl @a = (3,5,2,6); @b = (7,3,6); map { $x{$_} = -1 } @a; map { $x{$_} += 1 } @b; foreach (sort keys %x){ $val = $x{$_}; if(!$val) { print "$_:$_"; } elsif($val > 0){ print "-:$_"} else{ print "$_:-"}; print "\n"; } #@c = ( [2,'-'],[3,3],[5,'-'],[6,6],[7,'-']);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Merging the seperated
by MeowChow (Vicar) on Jul 04, 2001 at 10:21 UTC |