On Mon, Feb 05, 2001 at 03:13:59AM +0900, [EMAIL PROTECTED] ([EMAIL PROTECTED])
wrote:
>
> I'm puzzled by the output of this script:
> why is '$flag' gibberish and '$File_Modified_time' isn't?
It's not gibberish -- it's just not what you expected. Here's why:
> $flag=$ftp->mdtm('index.html');
> $File_Modified_time= localtime($ftp->mdtm('index.html'));
$File_Modified_time is a scalar, thus localtime() is called in scalar
context.
> print "\$flag converted is :\t",localtime($flag),"\n";
print() takes a list, so localtime() is called in list context.
>
[...]
> $flag converted is : 1014111014310
That's the output of the array that localtime() returned. Easier to
see if we go
$, = ","; print localtime ($whatever_you_had)
10,1,4,1,1,101,4,31,0
> $File_Modified_time is: Thu Feb 1 04:01:10 2001
which is the same as the date you see there.
-Rich
--
------------------------------ Rich Lafferty ---------------------------
Sysadmin/Programmer, Instructional and Information Technology Services
Concordia University, Montreal, QC (514) 848-7625
------------------------- [EMAIL PROTECTED] ----------------------