in reply to Simple array checking?

Sorry about the unmatched bracket, mistyped into perlmonks!! line 163=
if(!(@{$createdFiles->{$streamID}}||@{$modifiedFiles->{$streamID}}||@{ +$deletedFiles->{$streamID}})) { exit; }; Can't use an undefined value as an ARRAY reference at E:\Inetpub\cgi-b +in\wms.pl line 163.
I have already declared $createdFiles a a hash, the undefined value is i assume the key. I just want to know if they exit or not, i will try the exists function.

Replies are listed 'Best First'.
Re: Re: Simple array checking?
by perlplexer (Hermit) on Apr 12, 2002 at 13:56 UTC
    Alright, now we are getting somewhere. :)
    Here's what you can do:
    # !@{$array_ref} <-- Perl will complain about this if $array_ref is un +defined # $#{$array_ref} <-- but not this if($#{$createdFiles->{$streamID}} == -1){ print "Empty\n"; }

    --perlpelxer