Problème avec condition if
Résolu
ayrton16
Messages postés
14
Date d'inscription
Statut
Membre
Dernière intervention
-
ayrton16 Messages postés 14 Date d'inscription Statut Membre Dernière intervention -
ayrton16 Messages postés 14 Date d'inscription Statut Membre Dernière intervention -
Je n'ai jamais programmé en Perl, mais je dois écrire une instruction simple qui pourtant me pose problème...
Cela consiste à récupérer une variable (à partir d'un URL).
Si la variable "lang" = fr on assigne une certaine valeur à la variable BT-ACCUEIL
et si la variable "lang" = nl on assigne une autre valeur à la variable BT-ACCUEIL
Voici mon script :
----------------------------------------------------
my $reqLang=new CGI;
$varLang=$reqLang->param("lang");
$fr="fr";
$nl="nl";
if($varLang==$nl){
$BT_ACCUEIL="bt_accueil-nl.png";
}
elsif($varLang==$fr){
$BT_ACCUEIL="bt_accueil-fr.png";
}
print"$varLang\n";
print"$BT_ACCUEIL\n";
------------------------------------------------------
En testant, je vois que le paramètre "lang" est bien récupéré et bien stocké dans $varLang..
Mais $BT_ACCUEIL garde toujours la valeur du premier if....
Quelque chose m'échappe, auriez vous une solution?
Cela consiste à récupérer une variable (à partir d'un URL).
Si la variable "lang" = fr on assigne une certaine valeur à la variable BT-ACCUEIL
et si la variable "lang" = nl on assigne une autre valeur à la variable BT-ACCUEIL
Voici mon script :
----------------------------------------------------
my $reqLang=new CGI;
$varLang=$reqLang->param("lang");
$fr="fr";
$nl="nl";
if($varLang==$nl){
$BT_ACCUEIL="bt_accueil-nl.png";
}
elsif($varLang==$fr){
$BT_ACCUEIL="bt_accueil-fr.png";
}
print"$varLang\n";
print"$BT_ACCUEIL\n";
------------------------------------------------------
En testant, je vois que le paramètre "lang" est bien récupéré et bien stocké dans $varLang..
Mais $BT_ACCUEIL garde toujours la valeur du premier if....
Quelque chose m'échappe, auriez vous une solution?
A voir également:
- Problème avec condition if
- Excel cellule couleur si condition texte - Guide
- Excel condition ou - Guide
- Excel reporter des données sur une autre feuille avec conditions ✓ - Forum Excel
- Excel copier une cellule si condition ✓ - Forum Excel
- Nbval avec condition - Forum Excel