in reply to Re^3: How to calculate the column and print it in pie chart format using perl?
in thread How to calculate the column and print it in pie chart format using perl?

why you had used hashref is it not possible with arrayref?
  • Comment on Re^4: How to calculate the column and print it in pie chart format using perl?

Replies are listed 'Best First'.
Re^5: How to calculate the column and print it in pie chart format using perl?
by Corion (Patriarch) on Mar 22, 2017 at 09:42 UTC

    You can easily convert between arrayref and hashref.

    If converting between arrays and hashes is problematic for you, maybe you should review your Perl learning material or program some exercises about how to convert between an array and a hash (and a hash and an array).

    For example, you might have this array:

    #!perl -w use strict; # Name Age Street my @user = (qw(John 42 Infinityway)); my %user = ...;

    How would you convert the data from @user (an array) to a hash (%user)?

Re^5: How to calculate the column and print it in pie chart format using perl?
by huck (Prior) on Mar 22, 2017 at 09:49 UTC

    The names are easier for you to understand. your previous code used hashs.

    and what effective difference does it make, just how many rows are going to come back from that select? "use DBI;" probably cost more than hashref for this query.