[SLE] perl template::plugin question

From: Richard Bos (radoeka_at_xs4all.nl)
Date: 11/29/03

  • Next message: Stephen W: "[SLE] defrag for linux-answered at TLDP"
    To: suse-linux-e@suse.com
    Date: Sat, 29 Nov 2003 23:33:16 +0100
    
    

    The script referenced on the url below, used to work with previous perl-GD...
    versions that came with earlier suse versions.
    http://www.linuxgazette.com/issue83/misc/padala/simple.pl.txt
    (if have repeated the script below for completeness, it's not big really).

    It seems that the current version of perl-GD is treating the perl module
    GD::Graph::bars differently. It now uses templates or so? However, I don't
    the script running on suse9. Is there a perl guru out there that knows how
    to change the script so it runs on suse9?

    perl-Template-Toolkit-2.09-39 Sat 29 Nov 2003 11:18:03 PM CET
    perl-GD-2.07-47 Sat 29 Nov 2003 10:53:33 PM CET
    gd-2.0.15-48 Sat 29 Nov 2003 10:53:32 PM CET

    The error is:
    richard@pilchard:/usr/tmp> ./simple.pl > tmp1
    Can't locate GD/Graph/bars.pm in @INC (@INC
    contains: /usr/lib/perl5/5.8.1/i586-linux-thread-multi /usr/lib/perl5/5.8.1 /usr/lib/perl5/site_perl/5.8.1/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.1/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl .)
    at ./simple.pl line 5.

    -- 
    Richard Bos
    Without a home the journey is endless
    #!/usr/bin/perl -w
    # Change above line to point to your perl binary
    use CGI ':standard';
    use GD::Graph::bars;
    use strict;
    # Both the arrays should same number of entries.
    my @data = (["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
                 "Sep", "Oct", "Nov", "Dec"],
                [23, 5, 2, 20, 11, 33, 7, 31, 77, 18, 65, 52]);
    my $mygraph = GD::Graph::bars->new(500, 300);
    $mygraph->set(
        x_label     => 'Month',
        y_label     => 'Number of Hits',
        title       => 'Number of Hits in Each Month in 2002',
    ) or warn $mygraph->error;
    my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
    print "Content-type: image/png\n\n";
    print $myimage->png;
    -- 
    Check the headers for your unsubscription address
    For additional commands send e-mail to suse-linux-e-help@suse.com
    Also check the archives at http://lists.suse.com
    Please read the FAQs: suse-linux-e-faq@suse.com
    

  • Next message: Stephen W: "[SLE] defrag for linux-answered at TLDP"

    Relevant Pages