1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package Term::Choose_HAE; use warnings; use strict; use Unicode::GCString; use parent 'Term::Choose'; BEGIN { no warnings 'redefine'; *Term::Choose::_print_columns = sub { # als Funktion im "parent", weil es schnell sein soll. ( my $str = $_[0] ) =~ s/\e\[[\d;]*m//msg; Unicode::GCString->new( $str )->columns(); }; } # ... # ...
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
package Term::Choose_HAE; use warnings; use strict; use 5.010001; our $VERSION = '0.005'; use Exporter 'import'; our @EXPORT_OK = qw( choose ); use Unicode::GCString; use parent 'Term::Choose'; sub _print_columns { ( my $str = $_[0] ) =~ s/\e\[[\d;]*m//msg; Unicode::GCString->new( $str )->columns(); }; sub choose { if ( ref $_[0] ne 'Term::Choose_HAE' ) { return Term::Choose_HAE->new()->Term::Choose::__choose( @_ ); } my $self = shift; return $self->Term::Choose::__choose( @_ ); } 1; __END__
Quoteangenommen __choose verwendet die Funktion _print_columns
Quoteif the product you have changed changes with a new release it may very well break your patch