Posted by Toby A Inkster on 04/25/07 09:11
Skeleton Man wrote:
> print @{[someFunctionCall()]}[0];
PS -- this sort of thing is generally unsafe, as you've not checked that
the returned array even *has* an element with index 0. someFunctionCall
might be defined as:
function someFunctionCall ()
{
if (some error condition)
return FALSE;
else
return array(etc, etc, etc);
}
You should really check that someFunctionCall has returned an array, and
that the array has an element 0 before you try to print element 0 out!
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|