Perl widget

HD Thu Jun 21 15:49:54 Pacific Daylight Time 2001:

I created the following ultra-minimal application for playing with Perl. You just start it up and type in a Perl command, click "Execute", look at the output, debug the input, and repeat the cycle as many times as necessary until you have something that works. Since many cycles are frequently necessary in my case, I find it much more productive to do it this way than to keep editing and saving script files or to mess with entering commands at the DOS/Unix prompt. Note that perl must be in your path for this to work. On a Unix machine you would of course change "perl.exe" to "perl".

Hope someone else finds this useful. I'm sure it could be adapted for purposes other than Perl.

    text .t1 -height 12 -font {Courier 9}
    frame .f
    text .t2 -height 8 -bg bisque -font {Courier 9}
    button .f.b1 -text Execute -command perl
    button .f.b2 -text "Clear input" -command ".t1 delete 0.0 end"
    button .f.b3 -text "Clear output" -command ".t2 delete 0.0 end"
    pack .f.b1 .f.b2 .f.b3 -side left -padx 2
    pack .t1 .f .t2 -side top -pady 2

    proc perl {} {
        catch {exec perl.exe -e [.t1 get 0.0 end]} output
        .t2 delete 0.0 end
        .t2 insert end $output

VK 07-mar-2005 This script does not fit my expectation: I expected to see a widget, but see some kind of script that initially states its state far from perfect.

Instead, in my understanding, Perl widget is probably a widget written in Perl. Such an example of pure-perl widget exists at the bottom of Tcl::Tk page, and hopefully more on that will be at [L1 ]

Category GUI