in reply to Save Split to Array

spickles :Following up on your chatterbox message - let me just say that this community has absolutely the brightest minds in programming.

It is not uncommon to feel overwhelmed by flatly stated improvement suggestions (which you interpreted as criticism).

After 8 years in this community, I continue to be corrected - sometimes even cited for my ignorance. This can be humbling, but it is also educational to the extent that the ego bruise is barely noticeable.

On the subject of this message thread - as a former Network Admin - I can see where you want to go with this program - I'd STRONGLY recommend placing this information in a database - If you are a windows/office user - start with MS access. Create separate tables for DHCP-scope, VLAN, Subnets, switches+routers (Devices), ports, and endpoints (servers, workstations, Ip phones). You can use perl/DBI/Class::DBI to access/update these, but it is easier to use the database software for data entry. Database constraints can also help with data validation.

     Potentia vobiscum ! (Si hoc legere scis nimium eruditionis habes)

Replies are listed 'Best First'.
Re^2: Save Split to Array
by spickles (Scribe) on Aug 28, 2009 at 16:13 UTC
    NetWallah -

    I can handle all kinds of criticism - I realize Perl isn't my strong suit. But when someone responds with 'Instant code smell at this point. I don't even want to look further.' that's just not even necessary. There's two options there:
    (1) Ignore your gut reaction to respond that way and just don't say anything (our moms taught us that)
    (2) Respond with a way to help me understand why I get the 'use of uninitialized value' errors, thus resulting in my 'initialization string' at the opening of my script
    As for the database stuff, I can, and do use that often. I have written another PHP/Perl/MySQL interface that allows my company to process hundreds of lightweight access points to the customer's specifications, configure them, and provide a report. For my current application, it's just outputting a list of commands to be run on a switch that isn't local to me, and the output is going to be transient.

      merlyn's reference to "Code Smell" (Wikipedia) comes from recent (~8 years) software development vocabulary. I do not believe he intended it to be derogatory.

      Regarding your issue:
      Use of uninitialized value $_[0] in string eq at ***** line 63, <> line 2
      This is a result of your call:
      vlan_number();
      on line 118.

      That call does not pass any parameters to "vlan_number():.

      When you request $_[0], at line 62, it asks for the first parameter in @_;
      Since @_ (Parameter list) is empty, you get the warning.

           Potentia vobiscum ! (Si hoc legere scis nimium eruditionis habes)