I want to use PerlTray to add a perltray icon to my perl application im compiling with perltray using PDK I have looked at the sample code that activestate gives but nothing is making sense. I also want to add right click and and exit functionality to my current code below.

Also was curious if the icon size had to be 16x16 in order for an icon to display in the systray?
#!perl while (1) { use strict; use warnings; use LWP::UserAgent; use Time::Piece; use Win32; use PerlTray; 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; sleep 1800; }

In reply to PerlTray question and adding right click exit option on tray icon 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.