Recently, I mentioned dumping data in Perl. More recently, in the comments we learned about the "print_escapes" property. I decided I usually wanted that, so I added it to my .dataprinter file
# -*- perl -*- { print_escapes => 1, }
I also added the DataPrinter plugin to my .re.pl/repl.rc file
# -*- perl -*- use feature qw(say); use Term::ANSIColor; my @plugins = qw( Colors DataPrinter ### THIS IS THE ONLY THING I ADDED FancyPrompt ); sub myprompt { my $color = shift // 'black'; my $string = shift // '> '; sub {color('reset').color($color).$string.color('reset')}; } $_REPL->load_plugin($_) for @plugins; $_REPL->fancy_prompt(myprompt('green', 'perl5> ')); $_REPL->fancy_continuation_prompt(myprompt('blue', 'perl5* ')); # Don't leave the terminal like that! END {say '';}
So now I get a much more colorful REPL experience.
Note the other thing from garu's comment: the 'carriage return' gets quoted because I used a space instead of an underscore for it this time; the other hash keys do not get quoted.
Recent Comments