Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to create a "proper" array?

by Paladin (Vicar)
on Apr 10, 2015 at 19:31 UTC ( #1123066=note: print w/replies, xml ) Need Help??


in reply to How to create a "proper" array?

[1,2] is an array reference, not an array. To get an array reference from an array, use  \@arrayname. So in your second case:
while (@rowdata = $sth->fetchrow_array()) { push (@chart_data, $rowdata[2]+0); push (@chart_labels, $rowdata[0].' '.$rowdata[1].':00'); } $graph->to_string(\@chart_data, labels=>\@chart_labels);

Replies are listed 'Best First'.
Re^2: How to create a "proper" array?
by bfdi533 (Friar) on Apr 10, 2015 at 19:38 UTC
    Ah, I see. I was not aware of that. Thank for the pointer.
      Thank for the pointer.

      Made me smile.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2019-10-17 18:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?