in reply to Parsing output from Nmap::Scanner with varying hash address.
G'day mopmeat,
Welcome to the Monastery.
I'll just point out that 'keys HASHREF' is an experimental feature introduced in Perl v5.14 (see "perl5140delta: Syntactical Enhancements").
It's listed in perlexperiment but the link to [perl #119437], which is autogenerated, is wrong. It should be: https://rt.perl.org/Public/Bug/Display.html?id=119437.
The warnings: category is experimental::autoderef.
So, to ensure a Perl version of sufficient vintage to handle this, and to stop all the warnings, your code should start something like this:
#!/usr/bin/env perl use 5.014; use strict; use warnings; no warnings 'experimental::autoderef'; ...
Having said all that, consider whether you really want to use experimental features. They are subject to change (including removal) and it can be a real pain if you have change code to accommodate this.
I'd recommend sticking with 'keys %{$hashref}' unless you have some compelling reason not to.
-- Ken
|
---|