On Thu, Jan 24, 2002 at 03:56:20PM -0500, darren chamberlain wrote: : :Casey West <[EMAIL PROTECTED]> said something to this effect on 01/24/2002: :> On Thu, Jan 24, 2002 at 06:11:33PM +0000, Simon Wilcox wrote: :> :Should there be a .empty operator that returns true is empty where empty :> :means var is either null or undefined ? :> :> We already have something that *should* do this. .defined(). :> :> Just as in Perl, where defined(@foo) will only return true if @foo has :> elements. Problem is, array.defined doesn't do this correcty yet. : :$ perl -wle 'my @foo = (); print defined @foo' :defined(@array) is deprecated at -e line 1. : (Maybe you should just omit the defined()?) : :perl >= 5.6.0
There you go, using -w. :-) I was testing without it. For this application though, I still think defined() is right. Then again, I think it should work without defined. [% array = []; IF array; "yes"; END %] "yes" should never go to output in that example. Casey West -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/ Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/ Acacia Fraternity, Rensselaer Chapter. Brother #734