the code where I print it is : . . . elsif ($valeur_exit == -1) { $scripts_fatal[$#scripts_fatal + 1] = "$msgs_xml{'err_sw_sev'}. Script : @args_sw[1], (code retour : $valeur_exit)"; } else { $scripts_fatal[$#scripts_fatal + 1] = "$msgs_xml{'err_sw_sev'}. Script : @args_sw[1], (code retour : $valeur_exit)"; } . . .
when the exit value of the program is -1, $valeur_exit get the value 255 so it allways goes in the else{} part. I thought there was a way to explicitly declare $valeur_exit as a 1 byte signed value, but i didn't found it...I looked on the net, and found the function pack() which should solve my problem but didn't get it to work...I know I could do some bit manipulation to walk around this problem, but thought there may be a "clean" way to do it. Or maybe I just missed something obvious :) (It's my 2nd program in Perl) Walter Valenti <[EMAIL PROTECTED]> a écrit dans le message : [EMAIL PROTECTED] > Where you print $exit_value ??? > > >Hi, > >I have a problem with a program I did in Perl : > >I use the function system(@args) to launch an external command, > >and then get the exit value : $exit_value = $? >> 8. > >That runs fine, the problem is the exit value can be -1, so $exit_value > >should be a signed char. When the program returns -1, and I print > >$exit_value, I get 255...so I guess either it's an unsigned char, or an > >integer...is there a way to declare ma variable as a signed char? > >Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]