anonymoushydrogen has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: dynamic screen
by Fletch (Bishop) on Oct 14, 2008 at 13:57 UTC

    Well, first put down the crack pipe; that stuff's bad for you. Next (after you've come down and have regained some semblance of coherency) read How (Not) To Ask A Question and rephrase your question in terms that actually make sense and give enough context and relevant details (perhaps platform, what GUI toolkit you're tying to use, why you want to do this insane thing . . .).

    Or just keep hitting the pipe and bind the 'h' key to insert a 'y'. Whichever.

    Update: It's only been just about two months to the day since your last crapulently-written question when last you were pointed at How (Not) To Ask A Question. One would have hoped that would have been enough time to read and absorb . . .

    Update: And of course the original node has now been stealth updated to contain something completely different and yet almost as indistinguishable from the ravings of a crack-fueled maniac as the original was. Wow.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re: dynamic screen
by oko1 (Deacon) on Oct 14, 2008 at 16:15 UTC

    What fletch said. Meanwhile, just because I feel like playing:

    #!/usr/bin/perl -w use strict; use Term::ReadKey; my %hashed; @hashed{'a'..'z'} = 1..26; my @mixed = keys %hashed; ReadMode "raw"; while (my $key = lc(ReadKey(0))){ last if ord($key) == 27; # You can get out if you can figure it + out print $mixed[ord($key)-97]; } ReadMode "normal";

    Update: Added a statement to reset the tty to normal. Ya gotta do that after you've been insane. :)


    --
    "Language shapes the way we think, and determines what we can think about."
    -- B. L. Whorf
Re: peter answer game problem
by blazar (Canon) on Oct 14, 2008 at 16:39 UTC

    I personally believe that you should not update your node so drastically: if you were not satisfied with it, then you should have at least wrapped its old content within <strike> tags before adding the new one, or otherwise let people understand what it was about, because it's now completely different wrt how it was originally written, and some of the replies do not make sense any more. Actually, I'm considering it.

    --
    If you can't understand the incipit, then please check the IPB Campaign.
Re: peter answer game problem
by zentara (Cardinal) on Oct 14, 2008 at 19:59 UTC
    Here is something to play with.
    #!/usr/bin/perl use warnings; use strict; use Tk; require Tk::ROText; my %answers; while (<DATA>) { chomp ( my ( $key, $val ) = split /,\s+/ ); push @{$answers{$key}}, $val; } #print "$_ ", join( ", ", @{$answers{$_}} ), "\n" foreach sort keys %a +nswers; my $mw = new MainWindow; my $txt = $mw->Scrolled('ROText', -scrollbars=> 'ose')->pack; my $ent = $mw->Entry(-bg=>'white')->pack(qw/-fill x -pady 5/); $mw ->bind('<Any-Enter>' => sub { $ent->Tk::focus }); $ent->bind('<Return>' => [\&answer]); MainLoop; sub answer { my ($ent) = @_; my $text = $ent->get; $ent->delete(qw/0 end/); print $text, "\n"; if( ! exists $answers{$text} ){ $txt->insert('end',"$text No Luck\n"); }else{ $txt->insert('end',"$text @{$answers{$text}}\n"); } } __DATA__ What, on second Who, on third When, pitching Where, on first Why, catching How, second Whose, thats what I said

    I'm not really a human, but I play one on earth Remember How Lucky You Are