Help for this page

Select Code to Download


  1. or download this
    Name,Cost,Inventory
    pickles,2.99,12
    vegemite,4.00,8
    nuclear sub,22.50,4
    
  2. or download this
    open IN, "MyCSV.csv" or die "Cannot open input file: $!\n";
    
    ...
    # Now I can play with whole columns of data by name
    print “Total Inventory = ”, List::Util::sum(@{$columns{'Inventory'}}),
    + “\n”;
    print “Total Cost = ” , List::Util::sum(@{$columns{'Cost'}}), “\n”;