#!/usr/bin/perl use warnings; use strict; #769688 my ($sec, $min, $hr); # easier on your fingers; fewer "my"s... ($sec,$min,$hr) = localtime(time); if ( $sec =~ /(\d{1})/ ) { # deal with times ending w/0..9 seconds $sec = "0" . $1; } my $file = 'filename.zip'; #if you need to act upon a list of files, loop my @filenamearray = split(/\./, $file); my $newfilename = "$filenamearray[0]" . "-" . $hr . ":" . $min . ":" . $sec . "\." . $filenamearray[1]; print $newfilename . "\n"; #now upload $newfilename...