[Buffalo-pm] one liner

Kevin Christopher kevin at binarymojo.net
Sun Jun 22 16:47:58 CDT 2003


You're right. That command does deserve more attention. I use it quite a
bit myself to test bits of code, especially when I tackle something new
from "Programming Perl" to quickly make sure I understand a given Perl
function or module. It is also incredibly useful for me using  Windows at
work. "perl -de 0" at a DOS prompt window... next best thing to cygwin,
IMHO.

Kevin, do you think you'd need a full 1:00hr-1:30 or would this be more on
the scale of a "lightning" talk?

- Kevin


>> one of my favorite perl command line utilities:
>>
>> perl -de 0
>
> Hang on there - that deserves far more than a passing mention. In fact,
> I'd go so far as to say that this tiny line, which lets one
> interactively enter and test code, is almost certainly the most
> under-appreciated feature of the language.
>
> To clarify things, "perl -de 0" (aka. "perl -de0" or "perl -de 1") will
> invoke the perl debugger on the very short program "0" (or "1", or
> whatever). This alone is not very interesting, however, the perl
> debugger is a full-fledged interactive perl interpreter, evaluating
> anything you enter. It's extremely handy to test a couple lines of
> code, or see how a built-in function or module will handle a certain
> input. The debugger's "x" command is also very useful, as it will print
> out the contents of any complex data structure (e.g. an object, an
> array of hash refs, etc.).
>
> Not being able to leave well-enough alone, I've actually turned this
> concept into an entire program I call "psh" (perl shell). It lets you
> enter commands interactively just like the debugger, and uses
> Data::Dumper to print the results. I can't live without it.
>
> I'd love to demo this concept and program at a future meeting if
> there's time in our schedule. Let me know what you think.
>
>   - Kevin
>
>
> --
> Kevin Eye
> Web Applications Developer
> Creative Services and Marketing
> University at Buffalo
> 330 Crofts Hall
> Buffalo, NY 14260
> eye at buffalo.edu
> phone (716) 645-5000 x1435
> fax (716) 645-3765
>
> _______________________________________________
> Buffalo-pm mailing list
> Buffalo-pm at mail.pm.org
> http://mail.pm.org/mailman/listinfo/buffalo-pm






More information about the Buffalo-pm mailing list