all:bibles:langages:perl
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| all:bibles:langages:perl [2026/03/30 15:41] – [Fichiers textes] omeylhoc | all:bibles:langages:perl [2026/04/02 15:29] (Version actuelle) – [Installation manuelle] omeylhoc | ||
|---|---|---|---|
| Ligne 1193: | Ligne 1193: | ||
| make test | make test | ||
| make install | make install | ||
| + | </ | ||
| + | |||
| + | ==== Text::CSV ==== | ||
| + | |||
| + | Lecture de fichier csv | ||
| + | |||
| + | <code perl> | ||
| + | use strict; | ||
| + | use warnings; | ||
| + | use Text::CSV; | ||
| + | |||
| + | my $csv = Text:: | ||
| + | sep_char => ',', | ||
| + | binary => 1, | ||
| + | auto_diag => 1, | ||
| + | }); | ||
| + | |||
| + | open my $fh, '<: | ||
| + | or die " | ||
| + | |||
| + | # Lire la ligne d' | ||
| + | my $headers = $csv-> | ||
| + | $csv-> | ||
| + | |||
| + | # Lire les données ligne par ligne | ||
| + | while (my $row = $csv-> | ||
| + | print "Nom: $row-> | ||
| + | # Accès aux colonnes par leur nom d' | ||
| + | } | ||
| + | |||
| + | close $fh; | ||
| </ | </ | ||
all/bibles/langages/perl.1774878098.txt.gz · Dernière modification : de omeylhoc
