[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [linux-team] Perl



Pascal ayant deja repondu pour l'essentiel, je n'ajouterai qu'une chose:
Ou est la sortie???
La seule chose que je vois sortir vers STDOUT est justement le
Content-type...
Si tu veux qu'il se trouve dans l'en-tete de ton fichier gnu.style, il
serait peut-etre sage de faire
print GNUFILE "Content-type: image/gif\n\n";
(BTW, Pascal, je sais par experience que tu peux a priori te contenter
d'un \n\n - encore que je n'ai pas teste ca avec des gifs - n'en faisont
pas trop pour PetitMou(TM) tout de meme ;-)

A+

Chris

Bruno Mairlot wrote:

> Bonjour,
>
> j'ai un petit problème avec un script perl :
>
> Je voudrais faire un CGI qui crée une image a partir de gnuplot.
>
> Voici le script :
>
> #!/usr/bin/perl -w
>
> use strict;
>
> print "content-type: image/gif\n\n";
>
> system("cp gnuplot.style gnu.style");
> open(GNUFILE,">>gnu.style");
>
> print GNUFILE "\nplot \"$ARGV[0]\" w lp\n";
> close(GNUFILE);
>
> system("gnuplot gnu.style");
>
> Où l'argument est le nom du fichier qui contient les  données a
> calculer. Le problème est le suivant : Lorsque j'execute la commande
> gnuplot, il n'ecrit pas le header content-type: image/gif, mais le
> résultat est l'image gif.
>
> Et evidemment si je n'éxecute pas la commande system, ca passe. On
> dirait qu'il écrase le header.
>
> Quelqu'un a-t-il une idée de pourquoi ?
>
> Merci
>
> --
> First they ignore you...Second they laugh at you...
> Then they fight you......And then you win!
>                                 (Ghandi)
> ---------
> This message was sent by Majordomo 1.94.3. Please report problems to
> manu@rtfm.be. If you want to be deleted from the list, send a mail to
> majordomo@rtfm.be with "unsubscribe linux-team" in the body.

--
Christopher Bodenstein - IT Developer - mailto:cbodenstein@icon.be
Icon ® - realize your net value - http://www.icon.be
Gossetlaan 32    B-1702 Brussels - Belgium
tel * +32 2 467 95 30 - fax *  +32 2 467 95 49


begin:vcard 
n:Bodenstein;Christopher
tel;fax:+32 2 467 95 49
tel;work:+32 2 467 95 30
x-mozilla-html:TRUE
org:Icon;R&D
adr:;;Gossetlaan 32;Groot-Bijgarden;;1702;BELGIUM
version:2.1
email;internet:cbodenstein@icon.be
title:IT Developer
x-mozilla-cpt:;-6048
fn:Christopher Bodenstein
end:vcard