Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^5: 2014 Code Golf Challenge

by BrowserUk (Pope)
on Jan 01, 2014 at 20:56 UTC ( #1068872=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1068872]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-06-14 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (58 votes). Check out past polls.

    Notices?