my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
my @days = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
#< Config START >
my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
my @days = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
#< Config START >
-my $scan_dir = '/xxxxxxxxxxxxxxxxxxxxxx/sf-download/';
+my $scan_dir = shift(@ARGV)
+ or die "Local package directory not specified (first argument)\n";
+my $save_rss_file = shift(@ARGV)
+ or die "RSS output file path not specified (second argument)\n";
$target = $scan_dir . $fi1 . '/' . $fi2 . '/' . $fi3;
next if (!-e $target); # skip if file is not exist
$target = $scan_dir . $fi1 . '/' . $fi2 . '/' . $fi3;
next if (!-e $target); # skip if file is not exist
my $filedata;
open($filedata, "<", $target)
or die "Can't open '$target' to generate checksum $!";
my $filedata;
open($filedata, "<", $target)
or die "Can't open '$target' to generate checksum $!";
$target_line .= '<pubDate>';
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
gmtime($target_time);
$target_line .= '<pubDate>';
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
gmtime($target_time);
- $target_line .=
- "$days[$wday], $mday $months[$mon] "
- . ($year + 1900)
- . " $hour:$min:$sec GMT";
+ $target_line .= sprintf("%s, %s %s %d %.2d:%.2d:%.2d GMT",
+ $days[$wday], $mday, $months[$mon], ($year + 1900),
+ $hour, $min, $sec);