http://www.perlmonks.org?node_id=816412


in reply to I like Python's interactive shell a lot better than Perl's debugger. What are my alternatives?

If you want to run a quick Perl script without having to create & write in a file, you can run `perl` by itself and enter your code. End it with __END__ on its own line, or Ctrl-D, and then it will run what you've input.

I prefer ending with __END__ because then you can copy/paste the code and its output and see easily where the code ends and the output begins.

[kirsle@damocles ~]$ perl print "Hello world!\n"; use Digest::MD5 qw(md5_hex); for (1..5) { print "$_ => " . md5_hex($_) . "\n"; } __END__ Hello world! 1 => c4ca4238a0b923820dcc509a6f75849b 2 => c81e728d9d4c2f636f067f89cc14862c 3 => eccbc87e4b5ce2fe28308fd9f2a7baf3 4 => a87ff679a2f3e71d9181a67b7542122c 5 => e4da3b7fbbce2345d7772b0674a318d5 [kirsle@damocles ~]$