#!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.asp"); my $content = $response->content; open(my $output_fh, '>>', $output_file) or die "You may not have dropbox installed failed to open - $output_file $!"; print {$output_fh} "Your IP address is $content at $t\n"; close $output_fh; sleep 1800; }