in reply to Use of uninitialized value $_ in pattern match (m//)

You should delete all elements of the array each time through the loop, not assign the value undef to the 1st element. Change:
@net_configs = undef;
to:
@net_configs = ();

Tip #4 from the Basic debugging checklist: Data::Dumper

Replies are listed 'Best First'.
Re^2: Use of uninitialized value $_ in pattern match (m//)
by perlfan (Parson) on Mar 09, 2016 at 17:52 UTC
    For that matter, initialize

    my @net_configs = ();

      ... initialize my @net_configs = ();

      Why? What would  @net_configs look like if one were to depend on the default initialization of a newly-created lexical array?


      Give a man a fish:  <%-{-{-{-<