Created
August 14, 2021 10:36
-
-
Save perlancar/3f191a642dc6ada4ef177d315dd23fb7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Text::ANSITable; | |
use strict; | |
my %Flag; | |
foreach ( | |
'durian', 'rambutan', 'salak', 'belimbing', 'mangga' | |
) { $Flag { $_ } = undef; } | |
my $tw = 2; | |
my @ta = (); | |
my $tb = Text::ANSITable->new; | |
# $tb->color_theme("Text::ANSITable::Standard::NoGradation"); | |
$tb->columns(["X", "Y"]); | |
my $i; | |
foreach $i ( sort keys %Flag ) { | |
push @ta, $Flag{$i}, $i; | |
if ((scalar @ta) == $tw) { | |
$tb->add_row([@ta]); | |
@ta = (); | |
} | |
} | |
print $tb->draw; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment