http://www.perlmonks.org?node_id=1038784


in reply to Re: DIfference in days hours and second between dates
in thread DIfference in days hours and second between dates

I think its because he's showing some old code he wrote, not new code. I mentioned the "local our" oddity in an earlier question of his on Re: perl variable displayed as a hash value.

If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)

Replies are listed 'Best First'.
Re^3: local our
by davido (Cardinal) on Jun 13, 2013 at 16:11 UTC

    Yeah, I understand that it's old code. But "our" was introduced when, Perl 5.8 maybe? And "my" pretty much came with Perl 5. So where did the idiom come from? What book, what website, what teacher is promoting it? The idea came from somewhere, or a misinterpretation of an idea that came from somewhere. ;)

    It would never have been considered a "best practice" for variables that need to be lexically scoped to a subroutine in any version of Perl since Perl 5.


    Dave