in reply to Re: Error while using POSIX strftime
in thread Error while using POSIX strftime

Yes. It throws the same error after adding "my" as well. Updated the code. But I am still getting the same error.

Replies are listed 'Best First'.
Re^3: Error while using POSIX strftime
by Anonymous Monk on Sep 16, 2014 at 20:49 UTC

    Item 2 and 4 on the Basic debugging checklist: look at your data.

    use strict; use warnings; use POSIX qw(strftime); my @lt = localtime; use Data::Dumper; print Dumper(\@lt); my $datestring = strftime "%B %d %Y", @lt; print("date - $datestring\n");

    Please post the output.

Re^3: Error while using POSIX strftime
by toolic (Bishop) on Sep 16, 2014 at 20:34 UTC
    What version of Perl are you using? Perhaps it is a bug in an old version of POSIX
    perl -v
      version 5.16.3

        toolic asked you to post the output of perl -v so we can get a better picture of your system; even better, post the output of perl -V. Are you using Strawberry Perl, cygwin, or ActiveState, and do you possibly have multiple installed on your machine?

        Also, could you post what perl -MPOSIX -e 'print $POSIX::VERSION' outputs?