costas has asked for the wisdom of the Perl Monks concerning the following question:
The follwoing code does not work and gives the error:my @modifiedFiles = (); #assuming that this array is empty if (!@modifiedFiles) { exit; }
THis is quite an obvious error since $modifiedFiles->{$streamID} has no value. Is there however a function i can use to check wether this array exists at all without throwing up an error like this?my $modifiedFiles = {}; #assuming this array is empty if(!$modifiedFiles->{$streamID}}) { print "EXIT"; exit; }; ERROR: Can't use an undefined value as an ARRAY reference at E:\Inetpu +b\cgi-bin\wms.pl line 163.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple array checking?
by broquaint (Abbot) on Apr 12, 2002 at 13:28 UTC | |
|
Re: Simple array checking?
by perlplexer (Hermit) on Apr 12, 2002 at 13:26 UTC | |
|
Re: Simple array checking?
by tachyon (Chancellor) on Apr 12, 2002 at 13:45 UTC | |
|
Re: Simple array checking?
by costas (Scribe) on Apr 12, 2002 at 13:39 UTC | |
by perlplexer (Hermit) on Apr 12, 2002 at 13:56 UTC |