summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstderr64 <linuxwizard@voidnet.dy.fi>2023-09-11 01:30:07 +0300
committerstderr64 <linuxwizard@voidnet.dy.fi>2023-09-11 01:30:07 +0300
commitce8da7c4e7b75c5a4c2950eb5a44715751918d7a (patch)
tree2a6f86247e30658cf38894d2e64a0fe2020fe02b
downloadperlsh-ce8da7c4e7b75c5a4c2950eb5a44715751918d7a.tar.gz
perlsh-ce8da7c4e7b75c5a4c2950eb5a44715751918d7a.tar.zst
First commitHEADmaster
-rwxr-xr-xperlsh.pl19
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 = "";
+ }
+}