in reply to Tk-POP3-previewer

great...!!! but why in the text/header section I see only
ARRAY(0x2064544)???

cheers lorenzo

Replies are listed 'Best First'.
Re: Re: Tk-POP3-previewer
by zentara (Cardinal) on May 06, 2004 at 15:42 UTC
    I don't know. Are you using Windows? When you middle-click to get the headers, it just tops the msg and displays the text. For some reason, your system is seeing the return from the top method as an arrayref. If I'm interpreting your problem corrrectly, try changing this code:
    sub browseThis{ print chr(07); my @msgs = $h->info('selection'); my $msg = $msgs[0]; my $messref = $pop3->top($msg,10); $text->delete('1.0','end'); ####RIGHT HERE################# #$text->insert('end', $messref); $text->insert('end', @$messref); }

    Come to think of it, maybe I should change that, I never thought about it, because on my system, the $messref prints out as a string.


    I'm not really a human, but I play one on earth. flash japh
      Interesting. This seems to be another scalar vs. array vs. arrayref change between Tk800 and Tk804. Try the following code in Tk800 and Tk804. The first one shows the stringified array reference, while the second one shows the array.
      perl -MTk -e '$txt = tkinit->Text->pack; $txt->insert("end", [1,2,3]); +MainLoop'
      So to be portable: always write my($result) = $w->method instead of my $result = $w->method (e.g. for Tk::Listbox::curselection) and do not use the arrayref forms where it is possible (e.g. in Tk::Canvas::createLine).
      Hi!
      I had the same problem as Discipulus on Linux (RedHat). Changed the code as you suggested, now it works.
      BTW: Greate code (zentara++)