programming-examples/perl/Hash/Building a Price List.pl
2019-11-15 12:59:38 +01:00

8 lines
229 B
Perl

#!/usr/local/bin/perl
%inventory = (A=>45_000.00,b=>120.00,C=>450_000.00,d=>40.00);
open (INV, ">price.list");
foreach $item (sort keys %inventory){
print INV join(":", ($item, $inventory{"$item"})), "\n";
}
close INV;