in reply to Re^4: 2014 Code Golf Challenge
in thread 2014 Code Golf Challenge

What are you using as a REPL here?

An evolution of the 15 line script I wrote 10 years ago:

#! perl -slw use 5.010; use feature qw[ say state ]; use threads; use threads::shared; #use strict; #use Win32::API::Prototype; use Time::HiRes qw[ time sleep ]; use Benchmark qw[cmpthese]; use Data::Dump qw[ pp ]; ##$Data::Dump::MAX_WIDTH = 200; #use Data::Dumper; use Devel::Size qw[ size total_size]; use List::Util qw[ sum reduce max min maxstr minstr shuffle ]; $| = 1; $" = $, = ' ';#" while( 1 ) { $_code = ''; printf "[%s] Perl> ", $! || $@ || $? || 0; $_code .= <STDIN> until $_code =~ m[;;\s*$]; chomp $_code; system 1, 'cmd /k' and next if $_code =~ m[^!!;;\s*$]s; if( $_code =~ m[^!(.+);;\s*$]s ) { system "cmd.exe /c $1"; $! = ($? << 8); next; } last if $_code =~ m[^(quit|exit|q);;\s*$]; $! = 0; eval { local $ENV{ PERL_SIGNALS } = 'unsafe'; local $SIG{ INT } = sub{die;}; eval $_code }; }

It's pretty eclectic and in a constant state of flux; but it is by far the most used program on my system except possible my editor and browser both of which run constantly.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.