
hoptar
Novice
Nov 6, 2007, 9:33 AM
Views: 867
|
|
Re: [hoptar] subfunction return (true/false)
|
|
|
This is all I am trying to work with now: checkdate.pl: #/usr/bin/perl sub check_date ## Begin Check_date. { my @FN0 = split('\.',$ARGV[0]); my @FN1 = split('\.',$ARGV[1]); $D0 = $FN0[1]; $D1 = $FN1[1]; return ($D1 > $D0)? 1 : 0; } ## End Check_date 1 test.pl: #! /usr/bin/perl require 'checkdate.pl'; $A = &check_date("abcd.041031.gz" , "abcd.071030.gz"); print "$A\n"; if ($A) { print "This is True\n"; } else { die ("Old file is newer than the one on the server"); }
(This post was edited by hoptar on Nov 6, 2007, 9:55 AM)
|