Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

(Mis?)Reading perl docs,
my @timeData = localtime(time); print join(' ', @timeData); exit;
shows
Time::tm=ARRAY(0x997a264)
Should I be calling a module?

Replies are listed 'Best First'.
Re: localtime shows array reference
by ikegami (Patriarch) on Apr 25, 2011 at 06:22 UTC
    Earlier in the program, you must have requested to override localtime with one that returns an object. You can access the builtin localtime using
    my @timeData = CORE::localtime(time); print join(' ', @timeData);
Re: localtime shows array reference
by wind (Priest) on Apr 25, 2011 at 06:23 UTC
Re: localtime shows array reference
by Anonymous Monk on Apr 25, 2011 at 06:37 UTC
    Add
    print "$_\n", for %INC;
    And you'll see which modules are automatically loaded, I'm guessing Time::localtime

    Running perl -V would show something like

    ...
      Built under MSWin32
      Compiled at Oct 16 2010 05:10:19
      %ENV:
        PERL5LIB="fafafafa"
        PERL5OPT="-MTime::localtime"
      @INC:
        fafafafa
        C:/perl/site/5.12.2/lib/MSWin32-x86-multi-thread
        C:/perl/site/5.12.2/lib
        C:/perl/5.12.2/lib/MSWin32-x86-multi-thread
        C:/perl/5.12.2/lib
        .