in reply to Re: Construction/initialisation of empty hash
in thread Construction/initialisation of empty hash

Thanks for the quick reply!

In the original module, I do have use strict; at the top. Did you mean to say "You'll probably want to add use warnings; at the top..." in your second paragraph?

Just using the -w flag for now, this does show warnings under both 5.004 and 5.8.0, however it would still be interesting to know how/why the behaviour has changed.

Replies are listed 'Best First'.
Re: Re: Re: Construction/initialisation of empty hash
by dragonchild (Archbishop) on Apr 27, 2004 at 14:48 UTC
    I meant "errors", not "warning". Original node updated.

    Usually, one has the my as part of the variable initialization, like my %foo = ();, not separately. Perl is closer to C++ and Java than C, in that regard. Also, you can just say my %foo; and it will work as expected.

    As for why it changed ... I have no idea. 5.004_xx is somewhat different than 5.005_xx and above, in any number of ways. I wouldn't look to compare the two. (The way to think about them is that 5.004 is really 5.4, as compared to 5.6 and 5.8.)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose