Skip to content

The use of 'defined' with arrays is deprecated in later versions of Perl causing a program failure #1

Description

@sec-engineer

While trying to use this .pl file, it was discovered that the use of "defined' with arrays has been deprecated in Perl. Thus the line:

  "if (defined(@{$host->{'ports'}->[0]->{'ports'}})) {" 

fails under Perl V5.22, returning the error message -

"Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at c:\test\nmapxml2mm.pl line 71."

If the statement is corrected to read:

   "if (@{$host->{'ports'}->[0]->{'port'}}) {" 

then the program runs to completion and provides the requested .mm file

There are two places requiring this correction - lines 75 and 91 in the source file. Once the corrections are made the program produces the correct output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions