On 7/20/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 7/20/07, Adriano Ferreira <[EMAIL PROTECTED]> wrote: snip > Just adding to what John already said, it hangs because, when used > without arguments like script file names or " -e 'print qq{Hello, > world\n}' ", it expects the script is coming from the standard > input. > > So you can do > > $ perl -wT > > print "Hello, world!\n"; > > for (1..10) { > print STDOUT ('one','two','three')[$_ % 3]; > } > > Hello, world! > > ^D (or something that tells your system the stream is over) > > twothreeonetwothreeonetwothreeonetwo snipThere are also some Perl REPLs* out there that allow you to use a Perl interpreter interactively. zoidberg, a Perl shell: http://search.cpan.org/~pardus/Zoidberg-0.95/lib/Zoidberg.pm
zoidberg is intented to be a shell (like bash, zsh) only that the command language is Perl. Not exactly a simple REPL.
psh, another Perl shell: http://sourceforge.net/projects/psh/ Devel::REPL, a modern Perl REPL: http://search.cpan.org/~mstrout/Devel-REPL-1.001000/lib/Devel/REPL.pm
The modernity of Devel::REPL is at using state-of-art Perl OO like Moose and being extendable. Beyond that, this modernity means today some 5 seconds to start the interactive interpreter ;-) $ re.pl (5 seconds later, your prompt:) $
There are probably others out there.
I am one of the contenders here, having written Shell::Perl http://search.cpan.org/dist/Shell-Perl/ which needs severely more work to be a really decent REPL. But for now, it works (if you accept its limitations)
* REPL stands for Read, Eval, Print, Loop.
Cheers, Adriano Ferreira -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
