From 61c874b22e5694aa5a30725db1a68080acca7174 Mon Sep 17 00:00:00 2001 From: Andinus Date: Thu, 27 Aug 2020 13:50:21 +0530 Subject: Move tar_create, tar_list & ymd to the end These will mostly remain unchanged so I moved them to the end. --- leo.pl | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'leo.pl') diff --git a/leo.pl b/leo.pl index 64b461f..44266db 100755 --- a/leo.pl +++ b/leo.pl @@ -72,23 +72,6 @@ sub archive { print "\n" and tar_list($tar_file) if $options{verbose}; } -sub tar_create { run3 ["/bin/tar" , "cf", @_]; } -sub tar_list { run3 ["/bin/tar", "tvf", @_]; } - -sub ymd { - my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = - localtime(time); - - $year += 1900; # $year contains the number of years since 1900. - - # $mon the month in the range 0..11 , with 0 indicating January - # and 11 indicating December. - my @months = qw( 01 02 03 04 05 06 07 08 09 10 11 12 ); - my $month = $months[$mon]; - - return "$year-$month-$mday"; -} - sub HelpMessage { say qq{Archive files to $archive_dir. @@ -118,3 +101,20 @@ if ( $ARGV[0] and $dispatch{ $ARGV[0] } ) { } else { die say "leo: no such option\n"; } + +sub tar_create { run3 ["/bin/tar" , "cf", @_]; } +sub tar_list { run3 ["/bin/tar", "tvf", @_]; } + +sub ymd { + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = + localtime(time); + + $year += 1900; # $year contains the number of years since 1900. + + # $mon the month in the range 0..11 , with 0 indicating January + # and 11 indicating December. + my @months = qw( 01 02 03 04 05 06 07 08 09 10 11 12 ); + my $month = $months[$mon]; + + return "$year-$month-$mday"; +} -- cgit 1.4.1-2-gfad0