frenchface has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); @weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun); ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWee +k, $dayOfYear, $daylightSavings) = localtime(); $year = 1900 + $yearOffset; $theTime = "$hour_$weekDays[$dayOfWeek].txt"; print $theTime; open (MYFILE, '>>'$theTime); my $url = 'http://en51.tribalwars.net/map/tribe.txt'; use LWP::Simple; my $content = get $url; @array=split(/,/, $content); $n=1; $j=4; do { print MYFILE "@array[$n] @array[$j]\n"; $n=$n+5; $j=$j+5; } while ($n<=$#array); close (MYFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printing to file, which is a variable
by dasgar (Priest) on Sep 22, 2010 at 23:06 UTC | |
|
Re: printing to file, which is a variable
by Anonymous Monk on Sep 22, 2010 at 22:59 UTC | |
|
Re: printing to file, which is a variable
by zentara (Cardinal) on Sep 23, 2010 at 10:27 UTC |