Hey ppl, thanks for always show me some light, after a lot of tries im here to ask for some help with a noob question(i think). My codes bellow make a test using ping, to see if some hosts in a array are alive.
##text Scrolled## $textsc = $txtget->Scrolled ('Text', -scrollbars => 'oe', -width=> 33, -height => 32)->pack; ##Button## my $botaotest = $framebtest -> Button(-text => 'Test Ips!',-command => +\&gotest) -> pack(-side => 'left', -expand => 1,-ipadx => 145); sub gotest{ if ( @$ref){ $textsc->insert('end',"Lets see Wich Ips are ON...\n"); @ipsproxy = map("$_->{ip}", @$ref); $p = Net::Ping->new("icmp"); $p->bind('187.78.223.205 '); @validos = (''); foreach $aaa (@ipsproxy) { print "$aaa is "; unless ($p->ping($aaa, 3)){ print "Host OFF\n"; }else{ push @validos, "$aaa"; printf "ALIVE!!!\n"; sleep(1); } } $p->close(); @nwvalidos = join("\n",@validos); $textsc->insert('end',"Ips Alive:@nwvalidos"); }else{ $textsc->insert('end',"#########ERROR#########\n...I Need Ips to test, + dude!!!"); } }


Whats my problem?
1- When i press Test Buttom, if the array are empty, is shown in my Text Scrolled the msg "#########ERROR#########...I Need Ips...." OK It works! My problem is when i click Test buttom and my array have my ip list, the phrase "Lets see Wich Ips are ON..." is shown only after my ips tests, I need when i clicker in test buttom, the phrase appear first, and then my ip tests start.
>2 - All my ips test results(from foreach command) are being shown in my console, like
"187.115.68.237 is ALIVE!!!
187.44.99.77 is ALIVE!!!
200.131.50.10 is ALIVE!!!
200.198.42.245 is Host OFF
Theres some way to these tests are shown in real time in my Text/Scrolled?

I hope get some help. Thanks guys.

In reply to TK, insert and foreach by papaismurf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.