なんだか
なんだかグラフが描きたい気分になったので、ppm installとかしてみる。
C:\Documents and Settings\rinta>ppm install GD Downloading ActiveState Package Repository packlist...not modified Downloading GD-2.35...done Unpacking GD-2.35...done Generating HTML for GD-2.35...done Installing to site area...done 20 files installed C:\Documents and Settings\rinta>
あっけなく終了。この間のPlaggerの悪夢は何だったんだ。
・・・嘘でした。GDは入ったけど、その下のGraphとかが入ってないや。次に試したコマンドはこれ。
C:\Documents and Settings\rinta>perl -MCPAN -e "install GD::Graph" CPAN: Storable loaded ok Going to read C:\Perl\cpan\Metadata Database was generated on Tue, 24 Jul 2007 09:51:48 GMT CPAN: LWP::UserAgent loaded ok Fetching with LWP: http://ppm.activestate.com/CPAN/authors/01mailrc.txt.gz Going to read C:\Perl\cpan\sources\authors\01mailrc.txt.gz Fetching with LWP: http://ppm.activestate.com/CPAN/modules/02packages.details.txt.gz Going to read C:\Perl\cpan\sources\modules\02packages.details.txt.gz Database was generated on Tue, 07 Aug 2007 07:50:55 GMT There's a new CPAN.pm version (v1.9102) available! [Current version is v1.7602] You might want to try install Bundle::CPAN reload cpan without quitting the current session. It should be a seamless upgrade while we are running... Fetching with LWP: http://ppm.activestate.com/CPAN/modules/03modlist.data.gz Going to read C:\Perl\cpan\sources\modules\03modlist.data.gz Going to write C:\Perl\cpan\Metadata Running install for module GD::Graph Running make for B/BW/BWARFIELD/GDGraph-1.44.tar.gz Fetching with LWP: http://ppm.activestate.com/CPAN/authors/id/B/BW/BWARFIELD/GDGraph-1.44.tar.gz CPAN: Digest::MD5 loaded ok Fetching with LWP: http://ppm.activestate.com/CPAN/authors/id/B/BW/BWARFIELD/CHECKSUMS Checksum for C:\Perl\cpan\sources\authors\id\B\BW\BWARFIELD\GDGraph-1.44.tar.gz ok Scanning cache C:\Perl/cpan/build for sizes CPAN: Archive::Tar loaded ok GDGraph-1.44/ GDGraph-1.44/samples/ GDGraph-1.44/samples/sample15.pl GDGraph-1.44/samples/sample22.pl GDGraph-1.44/samples/sample18.pl GDGraph-1.44/samples/sample41.pl GDGraph-1.44/samples/sample57.pl GDGraph-1.44/samples/sample53.pl GDGraph-1.44/samples/sample21.pl GDGraph-1.44/samples/sample94.pl GDGraph-1.44/samples/sample55.pl GDGraph-1.44/samples/save.pl GDGraph-1.44/samples/sample23.pl GDGraph-1.44/samples/sample51.pl GDGraph-1.44/samples/sample61.pl GDGraph-1.44/samples/sample63.pl GDGraph-1.44/samples/sample19.pl GDGraph-1.44/samples/sample54.pl GDGraph-1.44/samples/sample52.pl GDGraph-1.44/samples/sample42.dat GDGraph-1.44/samples/sample64.pl GDGraph-1.44/samples/sample16.pl GDGraph-1.44/samples/rgb.txt GDGraph-1.44/samples/logo.png GDGraph-1.44/samples/sample95.pl GDGraph-1.44/samples/sample71.pl GDGraph-1.44/samples/sample13.pl GDGraph-1.44/samples/sample14.pl GDGraph-1.44/samples/Makefile GDGraph-1.44/samples/sample31.pl GDGraph-1.44/samples/sample62.pl GDGraph-1.44/samples/sample91.pl GDGraph-1.44/samples/sample92.pl GDGraph-1.44/samples/sample1A.pl GDGraph-1.44/samples/sample1B.pl GDGraph-1.44/samples/sample12.pl GDGraph-1.44/samples/sample56.pl GDGraph-1.44/samples/sample93.pl GDGraph-1.44/samples/sample11.pl GDGraph-1.44/samples/sample54.dat GDGraph-1.44/samples/sample42.pl GDGraph-1.44/samples/sample17.pl GDGraph-1.44/t/ GDGraph-1.44/t/images/ GDGraph-1.44/t/images/logo.xbm GDGraph-1.44/t/images/logo_gif_noext GDGraph-1.44/t/images/logo.jpeg GDGraph-1.44/t/images/logo.gif GDGraph-1.44/t/images/logo.jpg GDGraph-1.44/t/images/logo_ping_noext GDGraph-1.44/t/images/logo.xpm GDGraph-1.44/t/images/logo_alt.PNG GDGraph-1.44/t/images/logo_xpm_noext GDGraph-1.44/t/images/logo.png GDGraph-1.44/t/images/logo_jpeg_noext GDGraph-1.44/t/images/logo_xbm_noext GDGraph-1.44/t/data.tab GDGraph-1.44/t/axestype.t GDGraph-1.44/t/error.t GDGraph-1.44/t/use.t GDGraph-1.44/t/colour.t GDGraph-1.44/t/data.csv GDGraph-1.44/t/data.t GDGraph-1.44/t/bugfixes.t GDGraph-1.44/MANIFEST GDGraph-1.44/Dustismo_Sans.ttf GDGraph-1.44/Graph/ GDGraph-1.44/Graph/Error.pm GDGraph-1.44/Graph/Data.pm GDGraph-1.44/Graph/area.pm GDGraph-1.44/Graph/axestype.pm GDGraph-1.44/Graph/hbars.pm GDGraph-1.44/Graph/pie.pm GDGraph-1.44/Graph/bars.pm GDGraph-1.44/Graph/colour.pm GDGraph-1.44/Graph/FAQ.pod GDGraph-1.44/Graph/lines.pm GDGraph-1.44/Graph/linespoints.pm GDGraph-1.44/Graph/utils.pm GDGraph-1.44/Graph/points.pm GDGraph-1.44/Graph/mixed.pm GDGraph-1.44/Graph.pm GDGraph-1.44/README GDGraph-1.44/CHANGES GDGraph-1.44/META.yml GDGraph-1.44/Dustismo.LICENSE GDGraph-1.44/Makefile.PL CPAN.pm: Going to build B/BW/BWARFIELD/GDGraph-1.44.tar.gz Checking if your kit is complete... Looks good Warning: prerequisite GD::Text 0.80 not found. Writing Makefile for GD::Graph The automatic tests for GDGraph are not really a solid workout of the library. The best way to test the package is to run the examples before installing it. You can run the examples in the samples directory with `make samples` or by going into that directory, and just running `make`. If that fails, please read samples/Makefile.
-
-
-
- Unsatisfied dependencies detected during [B/BW/BWARFIELD/GDGraph-1.44.tar.g
-
-
うん、入った。で、試すのは次のコード。
use strict; use GD::Graph::bars; my @xLabels = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); my @data2002 = qw( 17 19 26 38 56 64 67 53 40 29 21 13 ); my @data2003 = qw( 19 24 27 41 56 69 75 60 44 33 22 15 ); my @data = ( \@xLabels, \@data2002, \@data2003 ); my $graph = GD::Graph::bars->new( 800, 600 ); $graph->set( title => "Rainfall 2002/2003", y_label => "Millimetres" ); my $image = $graph->plot( \@data ) or die( "Cannot create image" ); open( OUT, "testgraph.png") or die( "Cannot display image: $!" ); #Two-data-set bar chart binmode OUT; print OUT $image->png(); close OUT;
普通に終了。でも、ファイルが出来ていない。なんで?:; 分かった、出力ファイルである事をPerlに教えてやっていない。openのところはコレが正解。
open( OUT, ">testgraph.png") or die( "Cannot display image: $!" );