Hello! I need some help ... :-)
foreach my $row (@sensor_h) { push(@draw, {draw => { file => "../data/$row", legend => "Source 1", + thickness => 2, color => '00FF00' }}); }
... with Data::Dumper i see ...
$VAR1 = { 'draw' => { 'thickness' => 2, 'color' => '00FF00', 'legend' => 'Source 1', 'file' => '../data/4C0008008E4F7E10' } }; $VAR2 = { 'draw' => { 'thickness' => 2, 'color' => '00FF00', 'legend' => 'Source 1', 'file' => '../data/DE0008008E479910' } }; $VAR3 = { 'draw' => { 'thickness' => 2, 'color' => '00FF00', 'legend' => 'Source 1', 'file' => '../data/AB0008008E533410' } };
and now my problem / ask ...
$rrd->graph( #image => '-', image => "../images/" . $sensor . ".png", vertical_label => 'Sensors', width => $width, height => $height, start => time() - $period, draw => { file => "../data/sensor1.rrd", legend => "Source + 1", thickness => 2, color => '00FF00' }, @draw );
also, i need dinamic numbers of draw ( see on top). the error ...
'Odd number of elements in hash assignment at /usr/lib/perl5/site_perl +/5.8.8/RRDTool/OO.pm line 178. Illegal parameter 'HASH(0xf6cf030)' in graph() at graph.cgi line ...
How can i make then thats work ? Thanks a lot

In reply to help with rrdtool::oo and dinamic draw by guacamayo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.