Acme-ID-CompanyName
view release on metacpan or search on metacpan
script/gen-generic-ind-company-names view on Meta::CPAN
#B<Conditional compilation.> There is a plugin to optimize away unneeded logging
#statements, like assertion/conditional compilation, so they have zero runtime
#performance cost. See L<Log::ger::Plugin::OptAway>.
#
#Being lightweight means the module can be used more universally, from CLI to
#long-running daemons to inside routines with tight loops.
#
#=item * Flexible
#
#B<Customizable levels and routine/method names.> Can be used in a procedural or
#OO style. Log::ger can mimic the interface of L<Log::Any>, L<Log::Contextual>,
#L<Log::Log4perl>, or some other popular logging frameworks, to ease migration or
#adjust with your personal style.
#
#B<Per-package settings.> Each importer package can use its own format/layout,
#output. For example, a module that is migrated from Log::Any uses Log::Any-style
#logging, while another uses native Log::ger style, and yet some other uses block
#formatting like Log::Contextual. This eases code migration and teamwork. Each
#module author can preserve her own logging style, if wanted, and all the modules
#still use the same framework.
#
#B<Dynamic.> Outputs and levels can be changed anytime during run-time and logger
#routines will be updated automatically. This is useful in situation like a
#long-running server application: you can turn on tracing logs temporarily to
#debug problems, then turn them off again, without restarting your server.
#
#B<Interoperability.> There are modules to interop with Log::Any, either consume
#Log::Any logs (see L<Log::Any::Adapter::LogGer>) or produce logs to be consumed
#by Log::Any (see L<Log::ger::Output::LogAny>).
script/gen-generic-ind-company-names view on Meta::CPAN
#use warnings;
#use utf8;
#use parent 'Exporter';
#use Carp qw/ croak /;
#use Ref::Util 0.202 qw/ is_arrayref /;
#use String::TtyLength 0.02 qw/ tty_width /;
#
#our @EXPORT_OK = qw/ generate_table /;
#
## Legacy package globals, that can be used to customise the look.
## These are only used in the "classic" style.
## I wish I could drop them, but I don't want to break anyone's code.
#our $COLUMN_SEPARATOR = '|';
#our $ROW_SEPARATOR = '-';
#our $CORNER_MARKER = '+';
#our $HEADER_ROW_SEPARATOR = '=';
#our $HEADER_CORNER_MARKER = 'O';
#
#my %arguments = (
# rows => "the rows, including a possible header row, of the table",
# header_row => "if true, indicates that the first row is a header row",
# separate_rows => "if true, a separate rule will be drawn between each row",
# top_and_tail => "if true, miss out top and bottom edges of table",
# align => "either single alignment, or an array per of alignments per col",
# style => "styling of table, one of classic, boxrule, or norule",
# indent => "indent every row of the table a certain number of spaces",
# compact => "narrow columns (no space either side of content)",
#);
#
#my %charsets = (
# classic => { TLC => '+', TT => '+', TRC => '+', HR => '-', VR => '|', FHR => '=', LT => '+', RT => '+', FLT => 'O', FRT => 'O', HC => '+', FHC => 'O', BLC => '+', BT => '+', BRC => '+' },
# boxrule => { TLC => 'âÂÂ', TT => 'â¬', TRC => 'âÂÂ', HR => 'âÂÂ', VR => 'âÂÂ', FHR => 'âÂÂ', LT => 'âÂÂ', RT => 'â¤', FLT => 'âÂÂ', FRT => 'â¡', HC => 'â¼', FHC => 'âª', BLC => 'âÂÂ', BT => 'â´', B...
# norule => { TLC => ' ', TT => ' ', TRC => ' ', HR => ' ', VR => ' ', FHR => ' ', LT => ' ', RT => ' ', FLT => ' ', FRT => ' ', HC => ' ', FHC => ' ', BLC => ' ', BT => ' ', BRC => ' ' },
#);
#
script/gen-generic-ind-company-names view on Meta::CPAN
# my %param = @_;
#
# foreach my $arg (keys %param) {
# croak "unknown argument '$arg'" if not exists $arguments{$arg};
# }
#
# my $rows = $param{rows} or croak "you must pass the 'rows' argument!";
# my @rows = @$rows;
# my @widths = _calculate_widths($rows);
#
# $param{style} //= 'classic';
#
# $param{indent} //= '';
# $param{indent} = ' ' x $param{indent} if $param{indent} =~ /^[0-9]+$/;
#
# my $style = $param{style};
# croak "unknown style '$style'" if not exists($charsets{ $style });
# my $char = $charsets{$style};
#
# if ($style eq 'classic') {
# $char->{TLC} = $char->{TRC} = $char->{TT} = $char->{LT} = $char->{RT} = $char->{HC} = $char->{BLC} = $char->{BT} = $char->{BRC} = $CORNER_MARKER;
# $char->{HR} = $ROW_SEPARATOR;
# $char->{VR} = $COLUMN_SEPARATOR;
# $char->{FLT} = $char->{FRT} = $char->{FHC} = $HEADER_CORNER_MARKER;
# $char->{FHR} = $HEADER_ROW_SEPARATOR;
# }
#
# my $header;
# my @align;
# if (defined $param{align}) {
script/gen-generic-ind-company-names view on Meta::CPAN
#This takes an array ref with one entry per column,
#to specify the alignment of that column.
#Legal values are 'l', 'c', and 'r'.
#You can also specify a single alignment for all columns.
#ANSI escape codes are handled.
#
#Added in 1.00.
#
#=item *
#
#style
#
#Specifies the format of the output table.
#The default is C<'classic'>,
#but other options are C<'boxrule'> and C<'norule'>.
#
#If you use the C<boxrule> style,
#you'll probably need to run C<binmode(STDOUT, ':utf8')>.
#
#Added in 1.00.
#
#
#=item *
#
#indent
#
#Specify an indent that should be prefixed to every line
script/gen-generic-ind-company-names view on Meta::CPAN
#
#This will generate the following:
#
# | Pokemon | Type | Count |
# +------------+---------+-------+
# | Abra | Psychic | 5 |
# | Ekans | Poison | 123 |
# | Feraligatr | Water | 5678 |
#
#If you want a more stylish looking table,
#set the C<style> parameter to C<'boxrule'>:
#
# binmode(STDOUT,':utf8');
# generate_table(rows => $rows, header_row => 1, style => 'boxrule');
#
#This uses the ANSI box rule characters.
#Note that you will need to ensure UTF output.
#
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ‰ÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ‰ÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
# â Pokemon â Type â Count âÂÂ
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¼âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¼âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¤
# â Abra â Psychic â 5 âÂÂ
# â Ekans â Poison â 123 âÂÂ
# â Feraligatr â Water â 5678 âÂÂ
script/gen-generic-ind-company-names view on Meta::CPAN
#or a string with an alignment to apply to all columns:
#
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ‰ÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ‰ÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
# â Pokemon â Type â Count âÂÂ
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¼âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¼âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¤
# â Abra â Psychic â 5 âÂÂ
# â Ekans â Poison â 123 âÂÂ
# â Feraligatr â Water â 5678 âÂÂ
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ´âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ´âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
#
#If you're using the boxrule style,
#you might feel you can remove the padding on either side of every column,
#done by setting C<compact> to a true value:
#
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ‰ÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ‰ÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
# âÂÂPokemon âÂÂType âÂÂCountâÂÂ
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¼âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¼âÂÂâÂÂâÂÂâÂÂâÂÂâ¤
# âÂÂAbra âÂÂPsychicâ 5âÂÂ
# âÂÂEkans âÂÂPoison â 123âÂÂ
# âÂÂFeraligatrâÂÂWater â 5678âÂÂ
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ´âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ´âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
#
#You can also ask for a rule between each row,
#in which case the header rule becomes stronger.
#This works best when combined with the boxrule style:
#
# generate_table( ... , separate_rows => 1 );
#
#Which results in the following:
#
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ‰ÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ‰ÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
# â Pokemon â Type â Count âÂÂ
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâªâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâªâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¡
# â Abra â Psychic â 5 âÂÂ
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¼âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¼âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¤
# â Ekans â Poison â 123 âÂÂ
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¼âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¼âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ¤
# â Feraligatr â Water â 5678 âÂÂ
# âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ´âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâ´âÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂâÂÂ
#
#You can use this with the other styles,
#but I'm not sure you'd want to.
#
#If you just want columnar output,
#use the C<norule> style:
#
# generate_table( ... , style => 'norule' );
#
#which results in:
#
#
# Pokemon Type Count
#
# Abra Psychic 5
# Ekans Poison 123
# Feraligatr Water 5678
#
( run in 1.763 second using v1.01-cache-2.11-cpan-49f99fa48dc )