frals / mrtg-rrd.cgi

fork of mrtg-rrd.cgi http://www.fi.muni.cz/~kas/mrtg-rrd/
GNU General Public License v2.0
1 stars 1 forks source link

In newer versions of Perl, arrays and hashs cannot be verified with 'defined' #1

Closed kadooster closed 5 years ago

kadooster commented 7 years ago

Error message: defined(@array) is deprecated at /var/www/mrtg/mrtg-rrd.cgi line 490. \t(Maybe you should just omit the defined()?)

Just omiting 'defined' key won't work, once the array is also empty, generating another error.

By these means, I changed lines 500, 925 and 938 with conditions testing the var and the arrays, like this: if ( $directories{$dir}{subdir} && @{$directories{$dir}{subdir}}) {

It works, but not sure if this is the proper way of handling this.

frals commented 6 years ago

feel free to submit a PR and ill merge it :)