I
Ian Pellew
Hi All;
Code fragment to - if necessary, compile one file from another:-
I have titted around with Stat() as per Active Perl User Guide,
but lack the brains to work out why I can't get it to Perl compile.
From an XMLin string I split it for the two files:-
.. . . . . .
my @s = split /=/, $d;
for (scalar @s) {
if (/2/) {
my $make = $true;
if ( -r (my $sf = ${s[1]})) { # do we have the src?
if ( -w (my $tf = ${s[0]})) { # Is the target already
made?
$i = stat($tf); # cannot get $i =
(stat(${s[1]}))[9] to work ????
$i = @$i[9]; # Mtime
$j = stat($sf);
$j = @$j[9];
if ( $j < $i ) { $make=$false; print qq(Target is
younger than the source, So nothing to do.\n);}
} else {
$make = $true;
}
} else { Ummmmmmmm no src }
}
. . . . . . .
I think my problem is not understanding what a @$xx is.
The Mtime test should have a comparison of two stats rather than
amatuer effort.
Regards
Ian
Code fragment to - if necessary, compile one file from another:-
I have titted around with Stat() as per Active Perl User Guide,
but lack the brains to work out why I can't get it to Perl compile.
From an XMLin string I split it for the two files:-
.. . . . . .
my @s = split /=/, $d;
for (scalar @s) {
if (/2/) {
my $make = $true;
if ( -r (my $sf = ${s[1]})) { # do we have the src?
if ( -w (my $tf = ${s[0]})) { # Is the target already
made?
$i = stat($tf); # cannot get $i =
(stat(${s[1]}))[9] to work ????
$i = @$i[9]; # Mtime
$j = stat($sf);
$j = @$j[9];
if ( $j < $i ) { $make=$false; print qq(Target is
younger than the source, So nothing to do.\n);}
} else {
$make = $true;
}
} else { Ummmmmmmm no src }
}
. . . . . . .
I think my problem is not understanding what a @$xx is.
The Mtime test should have a comparison of two stats rather than
amatuer effort.
Regards
Ian