我的Google fu让我失望了.如何使用Perl提供已生成的图像?
例:
<html><body><img src="getimage.pl"></body></html>
getimage.pl里有什么?
解决方法
干得好:
#!/usr/bin/perl -w my $file = "inner-nav.gif"; my $length = (stat($file)) [10]; print "Content-type: image/gif\n"; print "Content-length: $length \n\n"; binmode STDOUT; open (FH,'<',$file) || die "Could not open $file: $!"; my $buffer = ""; while (read(FH,$buffer,10240)) { print $buffer; } close(FH);