Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by finddata (Sexton)
on Mar 22, 2017 at 09:38 UTC ( #1185424=note: print w/replies, xml ) Need Help??


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 (Pope) 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 (Parson) 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1185424]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2019-12-15 21:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?