develooper Front page | perl.beginners | Postings from January 2002

'exists' error

Thread Next
Nikola Janceski
January 30, 2002 11:15
'exists' error
Message ID:
I have two versions of perl (5.004_04, and 5.6.1)

it seems the older one doesn't like the following code:

sub somefunction {
	if(exists $_[0]){
		print "$_[0]\n";

Output of perl -c (of 5.004_4):
exists operator argument is not a HASH element at ....

any ideas why the old version dies and the new version has no problems? Is
there a work around for this (without patching) for the old version?

Nikola Janceski
Summit Systems, Inc.

Testimony is like an arrow shot from a long bow; the force of it depends on
the strength of the hand that draws it. Argument is like an arrow from a
cross-bow, which has equal force though shot by a child.
-- Francis Bacon

The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About