With my current code below I am attempting to do the following.
I am stuck and really needing the code to loop back over subroutine ip

1. Get compiled perltray icon code to compile to loop every 30 minutes
2. have 48x48 desktop icon and same 16x16 systray icon compiled once I get the loop working
3. have log file append new entries to the top shifting older entries to the bottom of log file

Thanks to all who reply

#!perl use strict; use warnings; use LWP::UserAgent; use Time::Piece; use Win32; use PerlTray; &ip; sub ip { my $t = localtime; my $username = Win32::LoginName; my $output_file = "C:/Users/$username/Dropbox/My_IP.txt"; my $ua = new LWP::UserAgent; $ua->agent('Mozilla/5.0'); my $response = $ua->get("http://automation.whatismyip.com/n09230945.as +p"); my $content = $response->content; open(my $output_fh, '>>', $output_file) or die "You may not have dropbox installed failed to open - $outpu +t_file $!"; print {$output_fh} "Your IP address is $content at $t\n"; close $output_fh; } sub Timer { sleep 10; \&ip } sub PopupMenu { return [ ['Refresh', \&ip], ['Exit', 'exit'] ]; } sub ToolTip {"MyIP_2_Dropbox"}

In reply to Need help with looping over subroutine and compiling 48x48 icon and 16x16 tray perltray pdk by diamondsandperls

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.