in reply to Re: Perl Style: Is initializing variables considered taboo?
in thread Perl Style: Is initializing variables considered taboo?

You should set arrays and hashes to the empty list.

my @this = ();
my %that = ();
  • Comment on Re^2: Perl Style: Is initializing variables considered taboo?

Replies are listed 'Best First'.
Re^3: Perl Style: Is initializing variables considered taboo?
by chromatic (Archbishop) on Aug 22, 2010 at 17:37 UTC

    Why?

    Have you ever had a declared array or hash not contain an empty list?

      Yes, see my above comment on mod_perl.

        Your comment stems from your misunderstanding of variable scope and how mod_perl works, it is not a bug in mod_perl, its a common pitfall