For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > August 2005 > JPEG and Perl









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author JPEG and Perl
CSUIDL PROGRAMMEr

2005-08-30, 6:58 pm

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

#!/usr/bin/perl
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
Thanks

James Taylor

2005-08-30, 6:58 pm

In article <1125424852.401765.228200@g47g2000cwa.googlegroups.com>,
CSUIDL PROGRAMMEr <syedamjad_a@yahoo.com> wrote:
>
> All I want to do is to display a image on my html page using perl.


Sorry, it is not clear why you need to use Perl to display an
image. Your code below has several problems, and I cannot guess
from reading it what you really want to do.

> Here is my code
>
> #!/usr/bin/perl


You should always use strict and warnings.

> print "Content-type:image/jpeg\n\n";


This looks like a CGI script that is about to supply JPEG data but
it then supplies HTML instead.

> print " </html>";


That end tag is out of place.

> print "<body>";


There is no doctype or head?

> print " <IMG SRC='emb.jpeg'> " ;
> print "</body>";
> print"</html>";
> Is it right or am i missing something


I don't think Perl is your problem. You need to understand more
about how CGI and HTML works. I suggest you ask in a group that
covers CGI (not this one). Try comp.infosystems.www.authoring.cgi.

--
James Taylor, London, UK PGP key: 3FBE1BF9
To protect against spam, the address in the "From:" header is not valid.
In any case, you should reply to the group so that everyone can benefit.
If you must send me a private email, use james at oakseed demon co uk.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com