Hi all,
Using the code below, can someone please tell how i can sort the contents in reg. no order?
I have been given this code by a friend and i'm confused!
sub missinglist () {
my $msg='';
foreach my $comp (sort keys %dealers) {
$msg.="\nmissing photographs for $dealers{$comp}->{'name'}\n\n";
foreach my $reg (keys %stock) {
my $car=$stock{$reg};
if ($car->{company} eq $comp && !defined($car->{photo})) {
$msg.=uc($reg)." $car->{make} $car->{model} $car->{stockno}\n";
} # if
} # foreach stock
} # foreach company
Using the code below, can someone please tell how i can sort the contents in reg. no order?
I have been given this code by a friend and i'm confused!
sub missinglist () {
my $msg='';
foreach my $comp (sort keys %dealers) {
$msg.="\nmissing photographs for $dealers{$comp}->{'name'}\n\n";
foreach my $reg (keys %stock) {
my $car=$stock{$reg};
if ($car->{company} eq $comp && !defined($car->{photo})) {
$msg.=uc($reg)." $car->{make} $car->{model} $car->{stockno}\n";
} # if
} # foreach stock
} # foreach company