in reply to Re^5: Check if array is null
in thread Check if array is null
That's interesting! It seems defined returns true if there once was data in the array.
my @array = (); print defined(@array)?1:0, $/; # 0 print scalar(@array)?1:0, $/; # 0 push(@array, 'bla'); pop(@array); print defined(@array)?1:0, $/; # 1 print scalar(@array)?1:0, $/; # 0 undef(@array); print defined(@array)?1:0, $/; # 0 print scalar(@array)?1:0, $/; # 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Check if array is null
by Limbic~Region (Chancellor) on Oct 06, 2004 at 17:20 UTC |