Article View: fj.lang.perl
Article #224CPANのscriptについて
From: Kazunori Nozaki
Date: Thu, 26 Mar 1998 00:00
Date: Thu, 26 Mar 1998 00:00
44 lines
2134 bytes
2134 bytes
$BLn:j!w2?EY$b$9$_$^$;$s!!$G$9!#(B
CPAN$B$N(Bscript$B$G(BGD.pm$B$r$D$+$C$F!";~4V$rI=<($9$k%W%m%0%i%`$d!"(B
$B%m!<%I%"%Y%l!<%8$rI=<($9$k%W%m%0%i%`$,$"$k$N$G$9$,!"(B
gd_time.pl$B$r$\$/$N%5!<%P!<$G$O(Bgd_time.cgi$B$K$7$J$$$H$@$a$J$N$G!"(B
$B$=$N$h$&$K$7$F!"(Bperl gd_time.cgi$B$H$9$k$H!"$$$A$*$&!"(B
Content-type: image/gif
GIF87aX$B�,(BX$$B'o(I)K$Bz%X6(IZ$B65(I^<$B�c)Lh2(tL(I6(B
$B|I�L(IW$B��(B;/$B5I(B
home/soccer/www/cgi-bin/CAPAN/06>
$B$H$J$j$^$9!#$G!"%V%i%&%6$+$i$_$k$H!"(BInternal Server Error$B$H(B
$B$G$^$9!#(Bno data$B$H$G$J$$$H$$$&$3$H$O!"(Bscript$B$,4V0c$C$F$$$k$N$G$7$g$&$+!)(B
#!/usr/local/bin/perl5
use lib qw(home/soccer /home/soccer/lib
/home/soccer/lib/perl5/site_perl);
use GD;
$| = 1;
print "Content-type: image/gif\n\n";
($seconds, $minutes, $hour) = localtime (time);
if ($hour > 12) {
$hour -= 12;
$ampm = "pm";
} else {
$ampm = "am";
}
if ($hour == 0) {
$hour = 12;
}
$time = sprintf ("%02d:%02d:%02d %s", $hour, $minutes, $seconds, $ampm);
$time_length = length($time);
$font_length = 8;
$font_height = 16;
$x = $font_length * $time_length;
$y = $font_height;
$image = new GD::Image ($x, $y);
$red = $image->colorAllocate (255, 0, 0);
$image->string (gdLargeFont, 0, 0, $time, $red);
print $image->gif;
exit(0);
$B$G$9$,!"$[$H$s$I$=$N$^$^$G$9!#!J85$N$b$N$H!K(B
$B$b$7$+$7$?$i%5!<%P!<$,$*$+$7$$$N$+$b!)(B
sunOS2.5.1$B$G%"%Q%C%A$@$C$?$H$*$b$$$^$9!#(B
Technical Details
Message-ID:
<35191E2A.1DECA493@ec.hokudai.ac.jp>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS X-Google-Thread: 1043e7,6a57540d0b8c5236,start X-Google-Attributes: gid1043e7,public From: Kazunori Nozaki <d080048@ec.hokudai.ac.jp> Subject: CPANのscriptについて Date: 1998/03/26 Message-ID: <35191E2A.1DECA493@ec.hokudai.ac.jp> X-Deja-AN: 337542865 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Reply-To: d080048@ec.hokudai.ac.jp Content-Type: text/plain; charset=iso-2022-jp Organization: Center for Information Processing Education, Hokkaido Univ., Sapporo, Japan. Newsgroups: fj.lang.perl