some-usable-scripts/perl/essai3.perl
2012-06-27 21:42:23 +02:00

30 lines
514 B
Perl
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/perl
use 5.16.0;
# Exercices tableaux
my @alphabet = ("a" .. "z");
my @cartes = ("01".."10","valet","dame","roi");
my @annee=("a1","a2","lp");
my @promo=@annee;
my @tout = (@alphabet , "trucmachin" , @cartes , 1145, "\n");
print @tout;
# Autre exercice
my @jours=("Lundi","Mardi","Mercredi");
# explicite
#foreach $jours(@jours)
#{
# print $jours."\n";
#}
say foreach @jours ;
# Perl : les nombres : < > <= >= == !=
# Chaînes : lt gt eq ne
# !~ et =~ sont des opérateurs d'appartenance