salut,

J'essai d'utilise Getopt::Long et j'ai un petit soucis
voial mon script :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl
 
use strict;
use Getopt::Long;
 
 
my $a1;
my $b2;
 
 
 
my $result = GetOptions (
 
"a1=i" => \$a1, # numeric
"b2=s" => \$b2, # string
);  
 
print "resultat  ".$result."\n";
 
print "Value for a1 = ".$a1."\n";
print "Value for b2 = ".$b2;
quand je l'execute je fait cela
>verif.pl -a 2 -b 12
et il m 'affiche bien
resultat 1
Value for a1 = 2
Value for b2 = 12
mais pourquoi resultat est egal à 1.
en theorie sous unix le code de retour pour une reussite est 0

comment cela se fait il????


merci