[rrd-users] Help creating graphs using Perl and command line; 'SCALAR' is not a valid function name
A Darren Dunham
ddunham at taos.com
Wed May 20 19:16:49 CEST 2009
Brian.Benson reported:
> I'm trying to learn RRDtool using the rrd-beginners web page. That
> web page shows a shell script and a Perl script that does some of the
> basics. I have removed almost all the Perl code and got down to the
> call to graph and I'm getting an error:
>
> "problem generating the graph: 'SCALAR' is not a valid function name"
And in fact the code on the page
<http://oss.oetiker.ch/rrdtool/tut/rrd-beginners.en.html> appears to be
either buggy, or formatted in a way that makes it easy to introduce the
bug for someone trying to copy it.
Perl code at the bottom appears with:
[...]
RRDs::graph ("/images/mem_$count.png", \
"--title= Memory Usage", \
"--vertical-label=Memory Consumption (MB)", \
"--start=$start_time", \
"--end=$end_time", \
"--color=BACK#CCCCCC", \
[...]
Backslashes are common to continue parts of a shell command on another
line, but perl doesn't use them that way. Instead, these backslashes
are creating references to the item following. The graph function
doesn't work with the references.
--
Darren
More information about the rrd-users
mailing list