$ perl -wMstrict -Mdiagnostics -le 'my @array; print defined(@array)'
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at -e
line 1 (#1)
(F) defined() is not 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.
Uncaught exception from user code:
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at -e line 1.
$ perl -wMstrict -le 'my @array=(undef); print @array?"true":"false"'
true
####
$ perl -wMstrict -MData::Dump -e 'my @array; dd @array; $_="";
@array = split(",",$_ ); dd @array'
()
()
####
$ perl -wMstrict -MData::Dump -e 'dd split /-|(x)/, "-", -1'
("", undef, "")