pour JAsmine!
oui je les déclares en haut de ma fonction!Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 sub switch { my $lign; my ($switch_name,$switch_ip,$user_login,$user_password); $#switchs_database; ## La variable $var prend successivement toutes les valeurs scalaires contenues dans $switchs_database foreach $lign (1 .. $#switchs_database) { foreach my $var (@{$switchs_database[$lign]}) { $switch_name = $switchs_database[$lign]->[0]; $switch_ip = $switchs_database[$lign]->[1]; $user_login = $switchs_database[$lign]->[2]; $user_password = $switchs_database[$lign]->[3]; } print "$switch_name\t$switch_ip\t$user_login\t$user_password\n"; } &backup ($switch_name,$switch_ip,$user_login,$user_password); }
oui j'utilise warnings et strict
et ca me met des petites erreurs
"Use of uninitialized value in concatenation (.) or string at ./script_backup2.pl line 132.
Use of uninitialized value in concatenation (.) or string at ./script_backup2.pl line 153."
voila