On Mon, 19 Nov 2001, Newton, Philip wrote:

> [Warning: contains nitpicking]
> 
> nemesis wrote:
> > #!/usr/local/bin/perl -w
> > use strict;
> > my $image_url = 'http://www.fyshbowl.org/temp/announcement.jpg';
> > print "Content-type: text/html\n\n";
> > print "<img src=\"$image_url\" alt=\"Lame excuse for sending 
> > the URL to an amusing imageto the mailing list\">\n";
> 
> Someone teach this poor, misguided soul about your choice of
> 
> (a) here docs
> (b) qq|| and alternative quoting delimiters
> (c) CGI.pm (if using CGI.pm for generating HTML rocks your boat)
> (d) Template Toolkit
> (e) -T
> (f) What a DOCTYPE is and how to comply with the one you chose[1]
> (g) all of the above
> 
> :)

Ok then wiseguy, why not just something like

    #!/usr/local/bin/perl -wT
    use strict;
    my $image = "temp/announcement.jpg"; # or whatever path appropriate
    print "Content-type: image/jpeg\n\n";
    open (IMG, "<$image") or die "can't open $image: $!";
    while(<IMG>) {
        print;
    }
    close(IMG) or warn "couldn't close $image: $!";
 
If nothing else it circumvents at least a few of your objections...




-- 
Chris Devers    

"People with machines that think, will in times of crisis, 
make up stuff and attribute it to me" - "Nikla-nostra-debo"


Reply via email to