[ssfr] [perl]utilisation sous divers user

[ Thread Index | Date Index | More debianworld.org/shellscript-fr Archives ]


hello all;
j'ai un script (largement améliorable) en perl, qui relève quelques info
météo grâce à GEO::Metar. vous pouvez le trouver la:
http://linuxette.suinot.org/tmp/meteo.pl
Mon soucis:
ça marche, je récupère bien la température, sous root ou non.
Mais, je voudrais l'utiliser avec cacti, et ce script s'exécute donc sous l'user
www-data. Et là, paf! voila mon test:

# su - www-data /usr/local/bin/temp.pl 
/usr/local/bin/temp.pl: line 10: use: command not found
/usr/local/bin/temp.pl: line 11: use: command not found
/usr/local/bin/temp.pl: line 12: use: command not found
/usr/local/bin/temp.pl: line 20: my: command not found
/usr/local/bin/temp.pl: line 21: my: command not found
/usr/local/bin/temp.pl: line 22: my: command not found
/usr/local/bin/temp.pl: line 23: my: command not found
/usr/local/bin/temp.pl: line 24: my: command not found
/usr/local/bin/temp.pl: line 27: syntax error near unexpected token `newline'
/usr/local/bin/temp.pl: line 27: `my $req = new HTTP::Request GET =>'

Je suspecte un problème de variable d'environnement, mais peut être aussi
mon script est il à mettre au pilon :(

merci de vos avis
Rémi.

-- 
R. Suinot: http://remi.suinot.org => page perso
           http://linuxette.suinot.org => SpÃcifique a linux

---


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/