some-usable-scripts/perl/essai3.perl

30 lines
514 B
Perl
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

#!/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