显示led 数字的perl程序

#!/usr/bin/perl -w
use strict;

open FONT, "font.txt";
chomp(my @font = <FONT>);
close FONT;
my @led = map { s/(.{4})/$1,/g; split /,/ } @font;


chomp(my $num = <>);
my @n = split //, $num;
for (0..6) {
for my $n(@n) {
print $led[$n+10*$_];
}
print "\n";

}

_____________font.txt_____________

-- -- -- -- -- -- -- --
| || | || || | || || |
| || | || || | || || |
-- -- -- -- -- -- --
| || | | | || | || | |
| || | | | || | || | |
-- -- -- -- -- -- --

你可能感兴趣的:(perl)