diff options
Diffstat (limited to 'perlsh.pl')
-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 = ""; + } +} |