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
| #!/usr/bin/perl5.16
#one.pl;
use encoding::source 'utf8';
binmode(STDOUT, ":utf8");
binmode(STDOUT=>':encoding(utf8)');
use utf8;
use strict; # quote strings, declare variables
use warnings; # on by default
use warnings qw(FATAL utf8); # fatalize encoding glitches
use open qw(:std :utf8); # undeclared streams in UTF-8
use feature qw(say);
use Text::Unaccent::PurePerl qw(unac_string);
use Seul;
use Fabrique;
my $fabrique = Fabrique->new();
sub init
{
my $self = shift;
my $nom_hbn;
my $sujethbn;
while (1) {
$nom_hbn='';
say "Quel hbn ? exit pour quitter";
$nom_hbn = <>;
chomp($nom_hbn);
if ($nom_hbn eq 'exit'){exit}
$nom_hbn = unac_string( 'iso-8859-1', $nom_hbn);
my $sp = Seul->new();
$sp->seul($fabrique, $nom_hbn);
#je cree le node adresse svg
####################
say "un autre hbn : dites no pour quitter";
my $auto = <>;
chomp($auto);
if ($auto eq 'no'){exit}else{init($self)}
}
}
init;
exit 0 |
Partager