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

'exists' error

Thread Next
From:
Nikola Janceski
Date:
January 30, 2002 11:15
Subject:
'exists' error
Message ID:
1449413DA482D311B67000508B5A12F50592DC41@nyexchange01.summithq.com
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.
212-896-3400

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About