Tag: perl prompt

Cool Perl prompt

by on Jan.23, 2010, under Code, Posts

#!/usr/bin/env perl

do
  {
     print "perl#: ";
     chop($_ = <>);
     eval($_);
  }
while ($_ ne "exit")

There are times when I get an itching to start writing perl programs and tonight was no exception. I was curious as to how perl handled exceptions and so forth. After doing some reading on line I found a merely 9 lines of code that will serve you as an interactive perl prompt (think typing in python without any arguments.. and you’ll understand what I’m saying, or just give this piece of code a try yourself.)

http://feyd.ldc.usb.ve/docs/perl/practical-perl/www.cs.cf.ac.uk/Dave/PERL/node114.html

1 Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!