CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [hoptar] subfunction return (true/false): Edit Log



hoptar
Novice

Nov 6, 2007, 9:33 AM


Views: 1578
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)


Edit Log:
Post edited by hoptar (Novice) on Nov 6, 2007, 9:55 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives