1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
#!usr/perl/bin
use warnings;
use strict;
my $pseudo;
my $passe;
my $a;
my $c;
my $b;
my %tab;
my $choix;
print "Acceder a notre forum\n";
print "\nSe connecter:/connect\n";
print "Nouveau compte:/creation\n";
print "Informations oubliees: /oublier\n";
print "Quitter:/exit\n";
print "\n\n";
for(;;)
{
print "Votre choix:";
$choix=<STDIN>;
chomp($choix);
if ($choix =~ /creation/)
{
for(;;)
{
print "Pseudo:";
$a=<STDIN>;
chomp($a);
last if $a eq "/stop";
print "Passe:";
$b=<STDIN>;
chomp($b);
print "Email:";
$c=<STDIN>;
chomp($c);
$tab{$a}=$b;
print "Les informations ont ete enregistrees\n";
print "$_ : $tab{$_}\n\n" for keys %tab;
}
}
####################################################
elsif ($choix =~ /connect/)
{
print "Pseudo:";
$pseudo=<STDIN>;
chomp($pseudo);
print "Passe:";
$passe=<STDIN>;
chomp($passe);
if (($pseudo eq $a) && ($passe eq $b))
{
print "Connection avec succes\n";
}
}
#############################################################
elsif ($choix =~ /oublier/)
{
open(INFORM,"inform.txt") || die("Echec ouverture fichier (inform.txt)\n");
while(<INFORM>)
{
print "$_\n";
}
close(INFORM);
}
last if $choix =~ /exit/;
} |
Partager