Problème de syntaxe [Perl] - Perl - Programmation
Marsh Posté le 12-12-2007 à 11:57:13
càd Elmoriq?
d'ailleurs dans le code original ligne 17 il n'y a pas de "" pour ipAdEntIfIndex ...
Marsh Posté le 12-12-2007 à 11:58:38
Documentation PERL : http://perldoc.perl.org
Et plus particulièrement, pour le cas qui t'occupes, la page concernant les opérateurs : http://perldoc.perl.org/perlop.html
edit : d'ailleurs, j'viens ainsi d'apprendre que \Q existe bien, mais je ne suis pas sûr de l'utilisation qui en est faite ici... tu es sûr que ce script que tu as pompé fonctionne ?
Marsh Posté le 12-12-2007 à 11:47:27
Bonjour j'ai récupéré ce script qui via SNMP récupére les adresses IP et Label des interfaces de routeurs Cisco.
Voici le résultat lors de l'éxecution du script qui montre que la syntaxe \Q pose pb (qui d'ailleurs je ne connaissais pas l'existence de ce paramétre) :
String found where operator expected at host.pl line 17, near "$rtr "ipAdEntIfIndex""
(Missing operator before "ipAdEntIfIndex"?)
Backslash found where operator expected at host.pl line 17, near ""ipAdEntIfIndex"\"
(Missing operator before \?)
Bareword found where operator expected at host.pl line 18, near "$rtr ipAdEntAddr"
(Missing operator before ipAdEntAddr?)
Backslash found where operator expected at host.pl line 18, near "ipAdEntAddr\"
Backslash found where operator expected at host.pl line 19, near "1.3.6.1.4.1.9.2.1.3.0\"
(Missing operator before \?)
Bareword found where operator expected at host.pl line 24, near "$rtr ifName"
(Missing operator before ifName?)
Backslash found where operator expected at host.pl line 24, near "$ifnum\"
(Missing operator before \?)
syntax error at host.pl line 17, near "$rtr "ipAdEntIfIndex""
syntax error at host.pl line 18, near "$rtr ipAdEntAddr"
syntax error at host.pl line 19, near "1.3.6.1.4.1.9.2.1.3.0\"
syntax error at host.pl line 24, near "$rtr ifName"
Execution of host.pl aborted due to compilation errors.
Meric d'avance pour votre aide.