diff options
author | stderr64 <linuxwizard@voidnet.dy.fi> | 2023-09-11 01:30:07 +0300 |
---|---|---|
committer | stderr64 <linuxwizard@voidnet.dy.fi> | 2023-09-11 01:30:07 +0300 |
commit | ce8da7c4e7b75c5a4c2950eb5a44715751918d7a (patch) | |
tree | 2a6f86247e30658cf38894d2e64a0fe2020fe02b | |
download | perlsh-ce8da7c4e7b75c5a4c2950eb5a44715751918d7a.tar.gz perlsh-ce8da7c4e7b75c5a4c2950eb5a44715751918d7a.tar.zst |
-rwxr-xr-x | perlsh.pl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/perlsh.pl b/perlsh.pl new file mode 100755 index 0000000..db2168d --- /dev/null +++ b/perlsh.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl +use POSIX; +use IO::File; +use Term::ReadLine; + +my $term_prompt = Term::ReadLine->new( "perlsh" ); +my $p_line = ""; + +while ( true ){ + $p_line = $term_prompt->readline( "\e[95mperlsh>\e[0m " ); + if ( $p_line eq "quit" or $p_line eq "q" ){ + undef $p_line; + exit( 0 ); + } + if ( defined($p_line) and length($p_line) > 0 ){ + eval( $p_line ); + $p_line = ""; + } +} |