in reply to Re: Tk-POP3-previewer
in thread Tk-POP3-previewer

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

Replies are listed 'Best First'.
Re: Re: Re: Tk-POP3-previewer
by eserte (Deacon) on May 06, 2004 at 16:43 UTC
    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).
Re: Re: Re: Tk-POP3-previewer
by mawe (Hermit) on May 06, 2004 at 16:17 UTC
    Hi!
    I had the same problem as Discipulus on Linux (RedHat). Changed the code as you suggested, now it works.
    BTW: Greate code (zentara++)