Re: JPEG and Perl



CSUIDL PROGRAMMEr wrote:
> Folks
> I am new to perl
> ALl want to do is to display a image on my html page using perl .
> Here is my code

As far as Perl is concerned some comments below

> #!/usr/bin/perl

You are missing
use strict;
use warnings;

> print "Content-type:image/jpeg\n\n";
> print " </html>";
> print "<body>";
> print " <IMG SRC='emb.jpeg'> " ;
> print "</body>";
> print"</html>";
> Is it right or am i missing something

Although technically there is nothing wrong with your Perl code (it will
print what you are telling it to print) I would replace the phletoria of
print statements with a single "here" document:

use warnings;
print <<EOT;
Content-type:image/jpeg

</html>
<body>
<IMG SRC='emb.jpeg'>
</body>
</html>
EOT

jue


.



Relevant Pages