in reply to Re: getting system time
in thread getting system time

I need to use
use Time::localtime;
because later in the script, I am using
$dateModified = ctime($attrs->mtime);
to get the timestamp of a file.

And if don't have the 'use Time' defined, then I get a 'Undefined subroutine &main::ctime called' error

So not just a question of If it hurts don't do it

Replies are listed 'Best First'.
Re^3: getting system time
by Eliya (Vicar) on Dec 02, 2011 at 16:23 UTC

    Try not importing stuff from the module, i.e.

    use Time::localtime (); # note the parentheses

    and then call the function fully qualified

    $dateModified = Time::localtime::ctime($attrs->mtime);

    (Or import only ctime, which should not clash.)