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
snip

There 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
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

There are probably others out there.

* REPL stands for Read, Eval, Print, Loop.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to