diamondsandperls has asked for the wisdom of the Perl Monks concerning the following question:
#!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"}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need help with looping over subroutine and compiling 48x48 icon and 16x16 tray perltray pdk
by zentara (Cardinal) on Jul 04, 2012 at 11:17 UTC | |
|
Re: Need help with looping over subroutine and compiling 48x48 icon and 16x16 tray perltray pdk
by Anonymous Monk on Jul 04, 2012 at 06:22 UTC | |
|
Re: Need help with looping over subroutine and compiling 48x48 icon and 16x16 tray perltray pdk
by cavac (Prior) on Jul 04, 2012 at 15:00 UTC | |
by diamondsandperls (Beadle) on Jul 04, 2012 at 18:43 UTC |