[rrd-users] Re: New to perl, strange behaviour

Claude R Trepanier/Bromont crtrepan at ca.ibm.com
Wed Feb 20 18:12:59 MET 2002

> I know this isn't a Perl mailing list but.....  The for loop needs to be
rewritten.  Try something like this:
>   my @Graph;
>   for $loop (1 .. $Members ) {
>      $Source  = "/mrtg/images/$Machine"."_cpu_"."$loop.rrd";
>      $Var     = "cpu"."$loop";
>      $Color   = getColor($loop);
>      push(@Graph,
>           ("DEF:$Var"."=$Source".":ds0:AVERAGE",
>            "LINE2:$Var"."$Color".":CPU $loop",
>            "GPRINT:$Var".":LAST:%8.1lf%s",
>            "GPRINT:$Var".":MAX:%8.1lf%s",
>            "GPRINT:$Var".":AVERAGE:%8.1lf%s",
>            "GPRINT:$Var".":MIN:%8.1lf%s\\n")
>      );
>   }

Thanks Todd, that works, stangely enough the @Graph variable once again
contains the same values.

So the important thing is that I now have a receipe that  works but I still
wonder why the two different results from the same string.

Claude R Trépanier
Support de l'infrastructure du réseau
IBM Bromont

Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list