On Thu, 12 Dec 2002 10:15:19 +0200, [EMAIL PROTECTED] (Octavian Rasnita)
wrote:

>Hi all,
>
>Can someone give me a correct example  of code that prints an image?

Here's an example that is as simple as it can get: :-)
##################################################
#!/usr/bin/perl
$file='image1.png';
print<<EOH; 
Content-Type: image/png

EOH
binmode STDOUT;
open (FH, "$file") or die "Can't open $file: $!";
while(<FH>){print}
close (FH);
exit 0;
#################################################

#you might want to use this

$/ = \8192; # read data in 8kbyte chunks rather than from LF to LF
            # see perldoc perlvar
print while <IMAGE>;
            


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to