$ perl -Mwarnings -Mdiagnostics -e '@array = (1,2,3); print defined(@array)' defined(@array) is deprecated at -e line 1 (#1) (D deprecated) defined() is not usually useful on arrays because it checks for an undefined scalar value. If you want to see if the array is empty, just use if (@array) { # not empty } for example. #### my $tSida = $sida + 1; if ((@annots) || (defined @{$links{'-1'}}) || (defined @{$links{$tSida}})) { $sidObjekt .='/Annots ' . mergeLinks() . ' 0 R'; } #### my $tSida = $sida + 1; if( @annots || @{$links{'-1'}} || @{$links{$tSida}} ) { $sidObjekt .= '/Annots ' . mergLinks() . ' 0 R'; }